From c45be9b99e9ad32afa25acbcf0bab13cf6ba483d Mon Sep 17 00:00:00 2001 From: life Date: Thu, 21 May 2015 12:00:56 +0800 Subject: [PATCH] =?UTF-8?q?electron=E4=BF=9D=E5=AD=98=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=8F=98=E7=81=B0=20#17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/js/app/native.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/public/js/app/native.js b/src/public/js/app/native.js index 26d0c7cd..ed261cc5 100644 --- a/src/public/js/app/native.js +++ b/src/public/js/app/native.js @@ -168,19 +168,20 @@ function Menu() { this.menu.append(this.openInBrowser); } Menu.prototype.canCopy = function(bool) { - this.copy.enabled = bool; + this.copy.enabled = !!bool; }; Menu.prototype.canCut = function(bool) { - this.cut.enabled = bool; + this.cut.enabled = !!bool; }; Menu.prototype.canPaste = function(bool) { - this.paste.enabled = bool; + this.paste.enabled = !!bool; }; Menu.prototype.canSaveAs = function(bool) { - this.saveAs.enabled = bool; + // Electron只接受bool + this.saveAs.enabled = !!bool; }; Menu.prototype.canOpenInBroswer = function(bool) { - this.openInBrowser.enabled = bool; + this.openInBrowser.enabled = !!bool; }; Menu.prototype.popup = function(x, y) { this.menu.popup(gui.getCurrentWindow(), x, y);