From d730e15cb0a4f00aba2832ecf9b2a53163324f24 Mon Sep 17 00:00:00 2001 From: Mathias Date: Sat, 3 Sep 2016 15:15:58 +0200 Subject: [PATCH] Only show debug menus when using --debug param --- scripts/components/menuMac.js | 4 +++- scripts/components/menuWin.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/components/menuMac.js b/scripts/components/menuMac.js index 1cdfec38..a6331446 100644 --- a/scripts/components/menuMac.js +++ b/scripts/components/menuMac.js @@ -113,6 +113,7 @@ angular.module('torrentApp').factory("menuMac", ['electron', '$rootScope', '$bit submenu: [ { label: 'Reload', + visible: electron.program.debug, accelerator: 'CmdOrCtrl+R', click(item, focusedWindow) { if (focusedWindow) focusedWindow.reload(); @@ -128,7 +129,8 @@ angular.module('torrentApp').factory("menuMac", ['electron', '$rootScope', '$bit }, { label: 'Toggle Developer Tools', - accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', + visible: electron.program.debug, + accelerator: 'Ctrl+Shift+I', click(item, focusedWindow) { if (focusedWindow) focusedWindow.webContents.toggleDevTools(); diff --git a/scripts/components/menuWin.js b/scripts/components/menuWin.js index 1e9be69d..285c4779 100644 --- a/scripts/components/menuWin.js +++ b/scripts/components/menuWin.js @@ -80,6 +80,7 @@ angular.module('torrentApp').factory("menuWin", ['electron', '$rootScope', '$bit submenu: [ { label: 'Reload', + visible: electron.program.debug, accelerator: 'CmdOrCtrl+R', click(item, focusedWindow) { if (focusedWindow) focusedWindow.reload(); @@ -95,7 +96,8 @@ angular.module('torrentApp').factory("menuWin", ['electron', '$rootScope', '$bit }, { label: 'Toggle Developer Tools', - accelerator: process.platform === 'darwin' ? 'Alt+Command+I' : 'Ctrl+Shift+I', + visible: electron.program.debug, + accelerator: 'Alt+Command+I', click(item, focusedWindow) { if (focusedWindow) focusedWindow.webContents.toggleDevTools();