fix preventing defaults in keyboard handler

This commit is contained in:
rlx 2014-09-24 00:33:49 +02:00
parent baeeff366e
commit 06dde25efe

View file

@ -81,6 +81,7 @@
}).map(function(key) {
return Ox.MODIFIER_KEYS[key];
}).concat(keyName).join('_'),
event = 'key.' + key,
triggerEvent = function() {
if ($element) {
$element.triggerEvent.apply($element, arguments);
@ -90,7 +91,7 @@
);
}
};
triggerEvent('key.' + key, e);
triggerEvent(event, e);
if (isKeysEventKey(key)) {
// don't register leading spaces or trailing double spaces
if (keyName != 'space' || (
@ -109,7 +110,7 @@
resetTimeout = setTimeout(function() {
keys = '';
}, 1000);
if (hasCallback[key]) {
if (hasCallback[event]) {
e.preventDefault();
}
}