From 65c969a32169970fd80db5792e9da7eb96756f63 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Mon, 18 Apr 2016 04:37:00 +0900 Subject: [PATCH] move devtool to main-menu --- browser/main/index.js | 9 --------- lib/main-menu.js | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/browser/main/index.js b/browser/main/index.js index 96cb5edb..6b146c27 100644 --- a/browser/main/index.js +++ b/browser/main/index.js @@ -10,15 +10,6 @@ import activityRecord from 'browser/lib/activityRecord' const electron = require('electron') const ipc = electron.ipcRenderer const path = require('path') -const remote = electron.remote - -if (process.env.NODE_ENV !== 'production') { - window.addEventListener('keydown', function (e) { - if (e.keyCode === 73 && e.metaKey && e.altKey) { - remote.getCurrentWindow().toggleDevTools() - } - }) -} activityRecord.init() window.addEventListener('online', function () { diff --git a/lib/main-menu.js b/lib/main-menu.js index 678dfaa9..6accf63b 100644 --- a/lib/main-menu.js +++ b/lib/main-menu.js @@ -146,6 +146,16 @@ var view = { click: function () { BrowserWindow.getFocusedWindow().reload() } + }, + { + label: 'Toggle Developer Tools', + accelerator: (function () { + if (process.platform === 'darwin') return 'Command+Alt+I' + else return 'Ctrl+Shift+I' + })(), + click: function () { + BrowserWindow.getFocusedWindow().toggleDevTools() + } } ] }