When quoting on the index, only change the target thread if the textarea is empty. Close #879
This commit is contained in:
parent
0477eb595c
commit
c720b90a86
@ -1993,7 +1993,8 @@
|
||||
e.preventDefault();
|
||||
}
|
||||
QR.open();
|
||||
if (!g.REPLY) {
|
||||
ta = $('textarea', QR.el);
|
||||
if (!(g.REPLY || ta.value)) {
|
||||
QR.threadSelector.value = $.x('ancestor::div[parent::div[@class="board"]]', this).id.slice(1);
|
||||
}
|
||||
id = this.previousSibling.hash.slice(2);
|
||||
@ -2003,7 +2004,6 @@
|
||||
s = s.replace(/\n/g, '\n>');
|
||||
text += ">" + s + "\n";
|
||||
}
|
||||
ta = $('textarea', QR.el);
|
||||
caretPos = ta.selectionStart;
|
||||
ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd);
|
||||
range = caretPos + text.length;
|
||||
|
||||
@ -1550,7 +1550,8 @@ QR =
|
||||
quote: (e) ->
|
||||
e?.preventDefault()
|
||||
QR.open()
|
||||
unless g.REPLY
|
||||
ta = $ 'textarea', QR.el
|
||||
unless g.REPLY or ta.value
|
||||
QR.threadSelector.value = $.x('ancestor::div[parent::div[@class="board"]]', @).id[1..]
|
||||
# Make sure we get the correct number, even with XXX censors
|
||||
id = @previousSibling.hash[2..]
|
||||
@ -1562,7 +1563,6 @@ QR =
|
||||
s = s.replace /\n/g, '\n>'
|
||||
text += ">#{s}\n"
|
||||
|
||||
ta = $ 'textarea', QR.el
|
||||
caretPos = ta.selectionStart
|
||||
# Replace selection for text.
|
||||
ta.value = ta.value[...caretPos] + text + ta.value[ta.selectionEnd..]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user