Use e.target instead of d.activeElement.

This commit is contained in:
Nicolas Stepien 2011-07-21 19:57:21 +02:00
parent fa498f3699
commit f010b7f2c3
2 changed files with 4 additions and 4 deletions

View File

@ -745,7 +745,7 @@
cb: {
keydown: function(e) {
var key, o, range, selEnd, selStart, ta, thread, valEnd, valMid, valStart, value, _ref, _ref2, _ref3;
if (((_ref = d.activeElement.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) {
if (((_ref = e.target.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) {
return;
}
key = keybinds.cb.keyCode(e);
@ -765,7 +765,7 @@
}
break;
case keybinds.spoiler:
ta = d.activeElement;
ta = e.target;
if (ta.nodeName !== 'TEXTAREA') {
return;
}

View File

@ -537,7 +537,7 @@ keybinds =
cb:
keydown: (e) ->
return if d.activeElement.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27)
return if e.target.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27)
key = keybinds.cb.keyCode e
if e.altKey then key = 'alt+' + key
if e.ctrlKey then key = 'ctrl+' + key
@ -550,7 +550,7 @@ keybinds =
else if qr.el
qr.close()
when keybinds.spoiler
ta = d.activeElement
ta = e.target
return unless ta.nodeName is 'TEXTAREA'
value = ta.value