diff --git a/4chan_x.coffee b/4chan_x.coffee index ab26dca39..c6d101d79 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -552,6 +552,11 @@ quickReply = (e) -> m clone, listener: ['submit', formSubmit] target: 'iframe' + if getConfig 'Keyboard Actions' + inputs = $$ 'input[type=text], textarea', clone + for input in inputs + input.addEventListener 'focus', keyActRem, true + input.addEventListener 'blur', keyActAdd, true if not g.REPLY #figure out which thread we're replying to xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]' @@ -560,11 +565,6 @@ quickReply = (e) -> name: 'resto' value: x(xpath, this).name addTo clone, input - if getConfig 'Keyboard Actions' - inputs = $$ 'input[type=text], textarea', clone - for input in inputs - input.addEventListener 'focus', keyActRem, true - input.addEventListener 'blur', keyActAdd, true else if getConfig 'Persistent QR' submit = $ 'input[type=submit]', clone auto = n 'label', diff --git a/4chan_x.js b/4chan_x.js index 68dcaf3bc..765d2d7c4 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -714,6 +714,15 @@ listener: ['submit', formSubmit], target: 'iframe' }); + if (getConfig('Keyboard Actions')) { + inputs = $$('input[type=text], textarea', clone); + _ref = inputs; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + input = _ref[_i]; + input.addEventListener('focus', keyActRem, true); + input.addEventListener('blur', keyActAdd, true); + } + } if (!g.REPLY) { xpath = 'preceding::span[@class="postername"][1]/preceding::input[1]'; input = n('input', { @@ -722,15 +731,6 @@ value: x(xpath, this).name }); addTo(clone, input); - if (getConfig('Keyboard Actions')) { - inputs = $$('input[type=text], textarea', clone); - _ref = inputs; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - input = _ref[_i]; - input.addEventListener('focus', keyActRem, true); - input.addEventListener('blur', keyActAdd, true); - } - } } else if (getConfig('Persistent QR')) { submit = $('input[type=submit]', clone); auto = n('label', {