From fcaa38a6dd6acd7645758095b39a521ecfecf963 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 11 Sep 2017 16:24:27 +0300 Subject: [PATCH] fixed how menu button is handled... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/keyboard.js | 2 +- ui (gen4)/features/ui-widgets.js | 8 ++++++++ ui (gen4)/lib/widget/browse.js | 7 ++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index 2e8f65bb..ffac3207 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -337,7 +337,7 @@ module.GLOBAL_KEYBOARD = { // ribbon image stuff... - Menu: 'browseActions!: "/Image/" -- Image menu...', + Menu: 'showContextMenu', alt_I: 'Menu', alt_R: 'browseActions: "/Ribbon/" -- Ribbon menu...', diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 719f20ef..aadb8c12 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1836,6 +1836,14 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ 'ui-browse-actions', ], + actions: actions.Actions({ + showContextMenu: ['Interface/Show context menu...', + uiDialog(function(){ + return this.current ? + this.browseActions('/Image/') + : this.browseActions() })], + }), + handlers: [ ['imageMenu.pre', function(gid){ diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 39a7d27d..52fa6736 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -2405,9 +2405,10 @@ var BrowserPrototype = { evt.preventDefault() evt.stopPropagation() - debounced - && that.select($(this)) - && res.trigger('menu', txt) + if(debounced){ + that.select($(this)) + res.trigger('menu', txt) + } }) // append text elements... .append(p)