fix preventing defaults in keyboard handler
This commit is contained in:
parent
baeeff366e
commit
06dde25efe
1 changed files with 3 additions and 2 deletions
|
@ -81,6 +81,7 @@
|
||||||
}).map(function(key) {
|
}).map(function(key) {
|
||||||
return Ox.MODIFIER_KEYS[key];
|
return Ox.MODIFIER_KEYS[key];
|
||||||
}).concat(keyName).join('_'),
|
}).concat(keyName).join('_'),
|
||||||
|
event = 'key.' + key,
|
||||||
triggerEvent = function() {
|
triggerEvent = function() {
|
||||||
if ($element) {
|
if ($element) {
|
||||||
$element.triggerEvent.apply($element, arguments);
|
$element.triggerEvent.apply($element, arguments);
|
||||||
|
@ -90,7 +91,7 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
triggerEvent('key.' + key, e);
|
triggerEvent(event, e);
|
||||||
if (isKeysEventKey(key)) {
|
if (isKeysEventKey(key)) {
|
||||||
// don't register leading spaces or trailing double spaces
|
// don't register leading spaces or trailing double spaces
|
||||||
if (keyName != 'space' || (
|
if (keyName != 'space' || (
|
||||||
|
@ -109,7 +110,7 @@
|
||||||
resetTimeout = setTimeout(function() {
|
resetTimeout = setTimeout(function() {
|
||||||
keys = '';
|
keys = '';
|
||||||
}, 1000);
|
}, 1000);
|
||||||
if (hasCallback[key]) {
|
if (hasCallback[event]) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue