diff --git a/4chan_x.user.js b/4chan_x.user.js index 5123d6158..6b61ab04f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1687,7 +1687,7 @@ caretPos = ta.selectionStart; ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length); ta.focus(); - return ta.selectionStart = ta.selectionEnd = caretPos + text.length; + return ta.selectionEnd = ta.selectionStart = caretPos + text.length; }, refresh: function() { var m, newFile, oldFile, _ref; diff --git a/script.coffee b/script.coffee index 08a0c1ddf..1b4da00f2 100644 --- a/script.coffee +++ b/script.coffee @@ -1325,7 +1325,7 @@ qr = ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length) ta.focus() #move the caret to the end of the new quote - ta.selectionStart = ta.selectionEnd = caretPos + text.length + ta.selectionEnd = ta.selectionStart = caretPos + text.length refresh: -> $('[name=sub]', qr.el).value = ''