Skip to content

Commit

Permalink
released v3.10.1 #403 #406
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 23, 2022
1 parent c9f693b commit 0a8c8bc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
12 changes: 7 additions & 5 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.10.0
* hotkeys-js v3.10.1
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
Expand Down Expand Up @@ -573,13 +573,15 @@ function hotkeys(key, option, method) {
function trigger(shortcut) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
Object.keys(_handlers).forEach(function (key) {
var data = _handlers[key].find(function (item) {
var dataList = _handlers[key].filter(function (item) {
return item.scope === scope && item.shortcut === shortcut;
});

if (data && data.method) {
data.method();
}
dataList.forEach(function (data) {
if (data && data.method) {
data.method();
}
});
});
}

Expand Down
4 changes: 2 additions & 2 deletions dist/hotkeys.common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.10.0
* hotkeys-js v3.10.1
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
Expand Down Expand Up @@ -571,13 +571,15 @@ function hotkeys(key, option, method) {
function trigger(shortcut) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
Object.keys(_handlers).forEach(function (key) {
var data = _handlers[key].find(function (item) {
var dataList = _handlers[key].filter(function (item) {
return item.scope === scope && item.shortcut === shortcut;
});

if (data && data.method) {
data.method();
}
dataList.forEach(function (data) {
if (data && data.method) {
data.method();
}
});
});
}

Expand Down
12 changes: 7 additions & 5 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.10.0
* hotkeys-js v3.10.1
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2022 kenny wong <[email protected]>
Expand Down Expand Up @@ -577,13 +577,15 @@
function trigger(shortcut) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
Object.keys(_handlers).forEach(function (key) {
var data = _handlers[key].find(function (item) {
var dataList = _handlers[key].filter(function (item) {
return item.scope === scope && item.shortcut === shortcut;
});

if (data && data.method) {
data.method();
}
dataList.forEach(function (data) {
if (data && data.method) {
data.method();
}
});
});
}

Expand Down
Loading

0 comments on commit 0a8c8bc

Please sign in to comment.