From 551ff27229a9b47d1cce698cfad3822bb67a443b Mon Sep 17 00:00:00 2001 From: Yuriy Dybskiy Date: Fri, 16 Oct 2015 15:49:32 -0700 Subject: [PATCH] Add application menu --- build/main.js | 2 +- build/remote/Menu.js | 9 +++++---- src/remote/Menu.js | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/main.js b/build/main.js index 1e4a28bb..4ed1353a 100644 --- a/build/main.js +++ b/build/main.js @@ -57,4 +57,4 @@ app.on('ready', function () { process.exit(); }); }); -//# sourceMappingURL=sourcemaps/main.js.map \ No newline at end of file +//# sourceMappingURL=sourcemaps/main.js.map diff --git a/build/remote/Menu.js b/build/remote/Menu.js index db7d251e..fccea902 100644 --- a/build/remote/Menu.js +++ b/build/remote/Menu.js @@ -1,9 +1,10 @@ 'use strict'; +var BrowserWindow = require('browser-window'); var Menu = require('menu'); function setupMenu() { - return; + // return; var template = [ // { // label: 'Bieber', @@ -81,13 +82,13 @@ function setupMenu() { label: 'Reload', accelerator: 'Command+R', click: function click() { - getCurrentWindow().reload(); + BrowserWindow.getFocusedWindow().reload(); } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', click: function click() { - getCurrentWindow().toggleDevTools(); + BrowserWindow.getFocusedWindow().toggleDevTools(); } }] }, { @@ -118,4 +119,4 @@ function setupMenu() { module.exports = { setupMenu: setupMenu }; -//# sourceMappingURL=../sourcemaps/remote/Menu.js.map \ No newline at end of file +//# sourceMappingURL=../sourcemaps/remote/Menu.js.map diff --git a/src/remote/Menu.js b/src/remote/Menu.js index 764de207..03d27fc9 100644 --- a/src/remote/Menu.js +++ b/src/remote/Menu.js @@ -1,7 +1,8 @@ +let BrowserWindow = require('browser-window'); let Menu = require('menu'); function setupMenu() { - return; + // return; let template = [ // { // label: 'Bieber', @@ -99,12 +100,12 @@ function setupMenu() { { label: 'Reload', accelerator: 'Command+R', - click: function() { getCurrentWindow().reload(); } + click: function() { BrowserWindow.getFocusedWindow().reload() } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', - click: function() { getCurrentWindow().toggleDevTools(); } + click: function() { BrowserWindow.getFocusedWindow().toggleDevTools(); } }, ] },