Skip to content

Commit

Permalink
released v3.13.3 #466
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 19, 2023
1 parent 478ee66 commit c96985c
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
7 changes: 4 additions & 3 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.13.1
* hotkeys-js v3.13.3
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2023 kenny wong <[email protected]>
Expand Down Expand Up @@ -498,6 +498,9 @@ function hotkeys(key, option, method) {
}
if (typeof option === 'string') scope = option;

// 如果只允许单个callback,先unbind
if (single) unbind(key, scope);

// 对于每个快捷键进行处理
for (; i < keys.length; i++) {
key = keys[i].split(splitKey); // 按键列表
Expand All @@ -512,8 +515,6 @@ function hotkeys(key, option, method) {

// 判断key是否在_handlers中,不在就赋一个空数组
if (!(key in _handlers)) _handlers[key] = [];
// 如果只允许单个callback,重新设置_handlers
if (single) _handlers[key] = [];
_handlers[key].push({
keyup,
keydown,
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.

7 changes: 4 additions & 3 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.13.1
* hotkeys-js v3.13.3
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2023 kenny wong <[email protected]>
Expand Down Expand Up @@ -496,6 +496,9 @@ function hotkeys(key, option, method) {
}
if (typeof option === 'string') scope = option;

// 如果只允许单个callback,先unbind
if (single) unbind(key, scope);

// 对于每个快捷键进行处理
for (; i < keys.length; i++) {
key = keys[i].split(splitKey); // 按键列表
Expand All @@ -510,8 +513,6 @@ function hotkeys(key, option, method) {

// 判断key是否在_handlers中,不在就赋一个空数组
if (!(key in _handlers)) _handlers[key] = [];
// 如果只允许单个callback,重新设置_handlers
if (single) _handlers[key] = [];
_handlers[key].push({
keyup,
keydown,
Expand Down
7 changes: 4 additions & 3 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* hotkeys-js v3.13.1
* hotkeys-js v3.13.3
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
* Copyright (c) 2023 kenny wong <[email protected]>
Expand Down Expand Up @@ -502,6 +502,9 @@
}
if (typeof option === 'string') scope = option;

// 如果只允许单个callback,先unbind
if (single) unbind(key, scope);

// 对于每个快捷键进行处理
for (; i < keys.length; i++) {
key = keys[i].split(splitKey); // 按键列表
Expand All @@ -516,8 +519,6 @@

// 判断key是否在_handlers中,不在就赋一个空数组
if (!(key in _handlers)) _handlers[key] = [];
// 如果只允许单个callback,重新设置_handlers
if (single) _handlers[key] = [];
_handlers[key].push({
keyup,
keydown,
Expand Down
Loading

0 comments on commit c96985c

Please sign in to comment.