From 30571c322a24e6f8e6869ce5f227d98cff75afb7 Mon Sep 17 00:00:00 2001 From: michael-albin Date: Wed, 22 Sep 2021 14:42:34 +0200 Subject: [PATCH 1/3] Update package.xml --- src/package.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/package.xml b/src/package.xml index ca1dd4d..5ed3428 100644 --- a/src/package.xml +++ b/src/package.xml @@ -1,6 +1,6 @@ - + @@ -8,4 +8,4 @@ - \ No newline at end of file + From fe5584cd5111221731487c464541dc938591bf78 Mon Sep 17 00:00:00 2001 From: michael-albin Date: Wed, 22 Sep 2021 14:43:26 +0200 Subject: [PATCH 2/3] Update KeyboardShortcut.xml --- src/KeyboardShortcut/KeyboardShortcut.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/KeyboardShortcut/KeyboardShortcut.xml b/src/KeyboardShortcut/KeyboardShortcut.xml index 01dd66f..e0023a8 100644 --- a/src/KeyboardShortcut/KeyboardShortcut.xml +++ b/src/KeyboardShortcut/KeyboardShortcut.xml @@ -20,7 +20,13 @@ xTuWIvAW3RahaSYkTNI5xl6/3TpcVJ3lxR0OSj/J8qLAVvhTsydahIZvcYcpclyZqfzT55nHKKYe Behavior Setting this to true limits the listening to keyboard events if the key is pressed when focus is at an element which is within this container. - + + + Limit scope Button scope + Behavior + Setting this to true limits the triggering of the button to buttons with this container. Very useful for using this widget in a snippet that show multiple times on a page. + + Shortcuts Shortcuts From 46ff3e82a759d4d4f522188bb2243cadbe73143c Mon Sep 17 00:00:00 2001 From: michael-albin Date: Wed, 22 Sep 2021 14:45:35 +0200 Subject: [PATCH 3/3] Update KeyboardShortcut.js --- src/KeyboardShortcut/widget/KeyboardShortcut.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KeyboardShortcut/widget/KeyboardShortcut.js b/src/KeyboardShortcut/widget/KeyboardShortcut.js index 80840fc..503afb2 100644 --- a/src/KeyboardShortcut/widget/KeyboardShortcut.js +++ b/src/KeyboardShortcut/widget/KeyboardShortcut.js @@ -31,6 +31,7 @@ define([ shortcuts: [], disableInput: false, limitScope: false, + limitScopeButton: false, //internal variables @@ -79,7 +80,7 @@ define([ var buttonsLength = buttons.length; for (var i = 0; i < buttonsLength; i++) { button = buttons[i]; - if (button.offsetHeight != 0) { + if (button.offsetHeight != 0 && (!self.limitScopeButton || scope.contains(button))) { chosenButton = button; break; }