-
-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
478ee66
commit c96985c
Showing
7 changed files
with
19 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
|
@@ -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); // 按键列表 | ||
|
@@ -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, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
|
@@ -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); // 按键列表 | ||
|
@@ -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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
|
@@ -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); // 按键列表 | ||
|
@@ -516,8 +519,6 @@ | |
|
||
// 判断key是否在_handlers中,不在就赋一个空数组 | ||
if (!(key in _handlers)) _handlers[key] = []; | ||
// 如果只允许单个callback,重新设置_handlers | ||
if (single) _handlers[key] = []; | ||
_handlers[key].push({ | ||
keyup, | ||
keydown, | ||
|
Oops, something went wrong.