This commit is contained in:
Nicolas Stepien 2013-04-14 02:40:35 +02:00
parent 40582724e1
commit e4b195734a
2 changed files with 10 additions and 8 deletions

View File

@ -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.

View File

@ -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