Skip to content

Commit

Permalink
Build v3.6.11 #86
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 27, 2019
1 parent edf976c commit 7bbe88d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
9 changes: 6 additions & 3 deletions dist/hotkeys.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ var _modifier = {
cmd: isff ? 224 : 91,
command: isff ? 224 : 91
};
var _downKeys = []; // 记录摁下的绑定键

var modifierMap = {
16: 'shiftKey',
18: 'altKey',
Expand All @@ -136,6 +134,8 @@ for (var k = 1; k < 20; k++) {
modifierMap[isff ? 224 : 91] = 'metaKey';
_mods[isff ? 224 : 91] = false;

var _downKeys = []; // 记录摁下的绑定键

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -427,11 +427,14 @@ function hotkeys(key, option, method) {
} // 在全局document上设置快捷键


if (typeof element !== 'undefined' && !isElementBind(element)) {
if (typeof element !== 'undefined' && !isElementBind(element) && window) {
elementHasBindEvent.push(element);
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});
addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
2 changes: 1 addition & 1 deletion dist/hotkeys.common.min.js

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

9 changes: 6 additions & 3 deletions dist/hotkeys.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ var _modifier = {
cmd: isff ? 224 : 91,
command: isff ? 224 : 91
};
var _downKeys = []; // 记录摁下的绑定键

var modifierMap = {
16: 'shiftKey',
18: 'altKey',
Expand All @@ -134,6 +132,8 @@ for (var k = 1; k < 20; k++) {
modifierMap[isff ? 224 : 91] = 'metaKey';
_mods[isff ? 224 : 91] = false;

var _downKeys = []; // 记录摁下的绑定键

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -425,11 +425,14 @@ function hotkeys(key, option, method) {
} // 在全局document上设置快捷键


if (typeof element !== 'undefined' && !isElementBind(element)) {
if (typeof element !== 'undefined' && !isElementBind(element) && window) {
elementHasBindEvent.push(element);
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});
addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
9 changes: 6 additions & 3 deletions dist/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@
cmd: isff ? 224 : 91,
command: isff ? 224 : 91
};
var _downKeys = []; // 记录摁下的绑定键

var modifierMap = {
16: 'shiftKey',
18: 'altKey',
Expand All @@ -140,6 +138,8 @@
modifierMap[isff ? 224 : 91] = 'metaKey';
_mods[isff ? 224 : 91] = false;

var _downKeys = []; // 记录摁下的绑定键

var _scope = 'all'; // 默认热键范围

var elementHasBindEvent = []; // 已绑定事件的节点记录
Expand Down Expand Up @@ -431,11 +431,14 @@
} // 在全局document上设置快捷键


if (typeof element !== 'undefined' && !isElementBind(element)) {
if (typeof element !== 'undefined' && !isElementBind(element) && window) {
elementHasBindEvent.push(element);
addEvent(element, 'keydown', function (e) {
dispatch(e);
});
addEvent(window, 'focus', function () {
_downKeys = [];
});
addEvent(element, 'keyup', function (e) {
dispatch(e);
clearModifier(e);
Expand Down
Loading

0 comments on commit 7bbe88d

Please sign in to comment.