Skip to content

Commit c96985c

Browse files
committed
released v3.13.3 #466
1 parent 478ee66 commit c96985c

7 files changed

+19
-16
lines changed

dist/hotkeys.common.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* hotkeys-js v3.13.1
2+
* hotkeys-js v3.13.3
33
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
44
*
55
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
@@ -498,6 +498,9 @@ function hotkeys(key, option, method) {
498498
}
499499
if (typeof option === 'string') scope = option;
500500

501+
// 如果只允许单个callback,先unbind
502+
if (single) unbind(key, scope);
503+
501504
// 对于每个快捷键进行处理
502505
for (; i < keys.length; i++) {
503506
key = keys[i].split(splitKey); // 按键列表
@@ -512,8 +515,6 @@ function hotkeys(key, option, method) {
512515

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

dist/hotkeys.common.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hotkeys.esm.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* hotkeys-js v3.13.1
2+
* hotkeys-js v3.13.3
33
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
44
*
55
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
@@ -496,6 +496,9 @@ function hotkeys(key, option, method) {
496496
}
497497
if (typeof option === 'string') scope = option;
498498

499+
// 如果只允许单个callback,先unbind
500+
if (single) unbind(key, scope);
501+
499502
// 对于每个快捷键进行处理
500503
for (; i < keys.length; i++) {
501504
key = keys[i].split(splitKey); // 按键列表
@@ -510,8 +513,6 @@ function hotkeys(key, option, method) {
510513

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

dist/hotkeys.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* hotkeys-js v3.13.1
2+
* hotkeys-js v3.13.3
33
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
44
*
55
* Copyright (c) 2023 kenny wong <wowohoo@qq.com>
@@ -502,6 +502,9 @@
502502
}
503503
if (typeof option === 'string') scope = option;
504504

505+
// 如果只允许单个callback,先unbind
506+
if (single) unbind(key, scope);
507+
505508
// 对于每个快捷键进行处理
506509
for (; i < keys.length; i++) {
507510
key = keys[i].split(splitKey); // 按键列表
@@ -516,8 +519,6 @@
516519

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

0 commit comments

Comments
 (0)