fix: fix callback not executing when scope is `all`. (#434) (#432)

pull/385/head
jaywcjlove 2 years ago
parent ce461c9f30
commit e193f9a32e

@ -437,7 +437,7 @@ function dispatch(event, element) {
if (!(key in _handlers)) return;
for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
if (_handlers[key][_i].key) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);

File diff suppressed because one or more lines are too long

@ -435,7 +435,7 @@ function dispatch(event, element) {
if (!(key in _handlers)) return;
for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
if (_handlers[key][_i].key) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);

2
dist/hotkeys.js vendored

@ -441,7 +441,7 @@
if (!(key in _handlers)) return;
for (var _i = 0; _i < _handlers[key].length; _i++) {
if (event.type === 'keydown' && _handlers[key][_i].keydown || event.type === 'keyup' && _handlers[key][_i].keyup) {
if (_handlers[key][_i].key && _handlers[key][_i].scope === scope) {
if (_handlers[key][_i].key) {
var record = _handlers[key][_i];
var splitKey = record.splitKey;
var keyShortcut = record.key.split(splitKey);

File diff suppressed because one or more lines are too long

@ -302,7 +302,7 @@ function dispatch(event, element) {
(event.type === 'keydown' && _handlers[key][i].keydown)
|| (event.type === 'keyup' && _handlers[key][i].keyup)
) {
if (_handlers[key][i].key && _handlers[key][i].scope === scope) {
if (_handlers[key][i].key) {
const record = _handlers[key][i];
const { splitKey } = record;
const keyShortcut = record.key.split(splitKey);

Loading…
Cancel
Save