diff --git a/CHANGELOG.md b/CHANGELOG.md index 04d70e60e..430958603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fix regression concerning thread selection when quoting on the index. + ### 3.0.5 - *2013-04-14* - `Scroll to Last Read Post` is now optional, enabled by default. diff --git a/src/qr.coffee b/src/qr.coffee index 4ddb9d5c1..e1ca69e06 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -264,19 +264,19 @@ QR = text += ">#{s}\n" QR.open() - ta = QR.nodes.com - QR.nodes.thread.value = OP.ID unless ta.value + {com, thread} = QR.nodes + thread.value = OP.ID unless com.value - caretPos = ta.selectionStart + caretPos = com.selectionStart # Replace selection for text. - ta.value = ta.value[...caretPos] + text + ta.value[ta.selectionEnd..] + com.value = com.value[...caretPos] + text + com.value[com.selectionEnd..] # Move the caret to the end of the new quote. range = caretPos + text.length - ta.setSelectionRange range, range - ta.focus() + com.setSelectionRange range, range + com.focus() - # Fire the 'input' event - $.event 'input', null, ta + QR.selected.save com + QR.selected.save thread characterCount: -> counter = QR.nodes.charCount