Use e.target instead of d.activeElement.
This commit is contained in:
parent
fa498f3699
commit
f010b7f2c3
@ -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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user