aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorЛu Лinveгa <[email protected]>2019-06-02 14:37:29 +0900
committerGitHub <[email protected]>2019-06-02 14:37:29 +0900
commit7aa0e86f0cf40d12a30103cb91a2d3d90d88f889 (patch)
tree33d9f94afecf3098123a6859c5eb8fece6240701
parent6006198032fa2b831852b327fb0eb6a2766e8f23 (diff)
parentc351f0b3817aef960ba847595b8e3e6b5a8b90b2 (diff)
downloadOrca-7aa0e86f0cf40d12a30103cb91a2d3d90d88f889.tar.gz
Orca-7aa0e86f0cf40d12a30103cb91a2d3d90d88f889.zip
Merge pull request #127 from jhsu/focus-after-menu-selection
focus the browser window contents after a menu item is selected
-rw-r--r--desktop/sources/scripts/lib/controller.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/desktop/sources/scripts/lib/controller.js b/desktop/sources/scripts/lib/controller.js
index d3c4e24..6608a92 100644
--- a/desktop/sources/scripts/lib/controller.js
+++ b/desktop/sources/scripts/lib/controller.js
@@ -15,7 +15,10 @@ export default function Controller () {
this.add = function (mode, cat, label, fn, accelerator) {
if (!this.menu[mode]) { this.menu[mode] = {} }
if (!this.menu[mode][cat]) { this.menu[mode][cat] = {} }
- this.menu[mode][cat][label] = { fn: fn, accelerator: accelerator }
+ this.menu[mode][cat][label] = { fn: function(_menuItem, browserWindow) {
+ browserWindow.webContents.focus();
+ fn.apply(this, arguments);
+ }, accelerator: accelerator }
}
this.addRole = function (mode, cat, label) {