diff --git a/4chan_x.user.js b/4chan_x.user.js index 8ed9155e4..8d92b64c1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1667,8 +1667,7 @@ ta = $('textarea', qr.el); ta.value = ta.value.slice(0, ta.selectionStart) + text + ta.value.slice(ta.selectionEnd, ta.value.length); ta.focus(); - ta.selectionEnd = ta.selectionStart + text.length; - return window.getSelection().collapseToEnd(); + return ta.selectionStart = ta.selectionEnd = ta.selectionStart + text.length; }, refresh: function() { var m, newFile, oldFile, _ref; diff --git a/script.coffee b/script.coffee index e1644c1bf..afe6120dd 100644 --- a/script.coffee +++ b/script.coffee @@ -1305,8 +1305,7 @@ qr = ta.value = ta.value.slice(0, ta.selectionStart) + text + ta.value.slice(ta.selectionEnd, ta.value.length) ta.focus() #move the caret to the end of the new quote - ta.selectionEnd = ta.selectionStart + text.length - window.getSelection().collapseToEnd() + ta.selectionStart = ta.selectionEnd = ta.selectionStart + text.length refresh: -> $('[name=sub]', qr.el).value = ''