Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/KeyboardShortcut/KeyboardShortcut.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ xTuWIvAW3RahaSYkTNI5xl6/3TpcVJ3lxR0OSj/J8qLAVvhTsydahIZvcYcpclyZqfzT55nHKKYe
<category>Behavior</category>
<description>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.
</description>
</property>
</property>
<property key="limitScopeButton" type="boolean" required="true" defaultValue="false">
<caption>Limit scope Button scope</caption>
<category>Behavior</category>
<description>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.
</description>
</property>
<property key="shortcuts" type="object" isList= "true" required="false">
<caption>Shortcuts</caption>
<category>Shortcuts</category>
Expand Down
3 changes: 2 additions & 1 deletion src/KeyboardShortcut/widget/KeyboardShortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ define([
shortcuts: [],
disableInput: false,
limitScope: false,
limitScopeButton: false,


//internal variables
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/package.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="KeyboardShortcut" version="2.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="KeyboardShortcut" version="2.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="KeyboardShortcut/KeyboardShortcut.xml" />
</widgetFiles>
<files>
<file path="KeyboardShortcut/widget/" />
</files>
</clientModule>
</package>
</package>