mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-09 04:28:38 -05:00
Improve performance by removing signal-based zoom-in, zoom-out, etc functionality from the runtime environment. #5723
This commit is contained in:
@@ -12,6 +12,8 @@ import Menu, { MenuItem } from '../../../static/js/helpers/Menu';
|
||||
import getApiInstance from '../../../static/js/api_instance';
|
||||
import url_for from 'sources/url_for';
|
||||
import Notifier from '../../../static/js/helpers/Notifier';
|
||||
import { getBrowser } from '../../../static/js/utils';
|
||||
import { isMac } from '../../../static/js/keyboard_shortcuts';
|
||||
|
||||
const MAIN_MENUS = [
|
||||
{ label: gettext('File'), name: 'file', id: 'mnu_file', index: 0, addSepratior: true },
|
||||
@@ -20,6 +22,33 @@ const MAIN_MENUS = [
|
||||
{ label: gettext('Help'), name: 'help', id: 'mnu_help', index: 5, addSepratior: false }
|
||||
];
|
||||
|
||||
let { name: browser } = getBrowser();
|
||||
if (browser == 'Nwjs') {
|
||||
let controlKey = isMac() ? 'cmd' : 'ctrl';
|
||||
let fullScreenKey = isMac() ? 'F' : 'F10';
|
||||
|
||||
const RUNTIME_MENUS_OPTIONS = {
|
||||
runtime : {
|
||||
label: gettext('Runtime'),
|
||||
name: 'runtime',
|
||||
priority: 999,
|
||||
submenus: {
|
||||
configure: { label: gettext('Configure...'), name: 'configure', priority: 0, enable: true},
|
||||
view_log: { label: gettext('View log...'), name: 'view_log', priority: 1, enable: true},
|
||||
enter_full_screen: { label: gettext('Enter Full Screen'), name: 'enter_full_screen', enable: true, priority: 2, key: fullScreenKey, modifiers: isMac() ?`${controlKey}+ctrl` : controlKey},
|
||||
actual_size: { label: gettext('Actual Size'), name: 'actual_size', priority: 3, enable: true, key: '0', modifiers: controlKey},
|
||||
zoom_in: { label: gettext('Zoom In'), name: 'zoom_in', priority: 4, enable: true, key: '+', modifiers: controlKey},
|
||||
zoom_out: { label: gettext('Zoom Out'), name: 'zoom_out', enable: true, priority: 5, key: '-', modifiers: controlKey},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
pgAdmin.Browser.RUNTIME_MENUS_OPTIONS = RUNTIME_MENUS_OPTIONS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export default class MainMenuFactory {
|
||||
static createMainMenus() {
|
||||
pgAdmin.Browser.MainMenus = [];
|
||||
|
||||
Reference in New Issue
Block a user