Only pick thread when quoting. Not when opening an empty QR with the keybind.

This commit is contained in:
Nicolas Stepien 2012-01-27 18:04:30 +01:00
parent 18525ecee1
commit 21e07e4ac0
2 changed files with 3 additions and 10 deletions

View File

@ -1059,7 +1059,6 @@
} else { } else {
qr.open(); qr.open();
} }
if (!g.REPLY) qr.pickThread(thread.firstChild.id);
return $('textarea', qr.el).focus(); return $('textarea', qr.el).focus();
}, },
open: function(thread, tab) { open: function(thread, tab) {
@ -1323,15 +1322,12 @@
return qr.status(); return qr.status();
} }
}, },
pickThread: function(thread) {
return $('select', qr.el).value = thread;
},
quote: function(e) { quote: function(e) {
var caretPos, id, s, sel, ta, text, _ref; var caretPos, id, s, sel, ta, text, _ref;
if (e != null) e.preventDefault(); if (e != null) e.preventDefault();
qr.open(); qr.open();
if (!g.REPLY) { if (!g.REPLY) {
qr.pickThread($.x('ancestor::div[@class="thread"]/div', this).id); $('select', qr.el).value = $.x('ancestor::div[@class="thread"]/div', this).id;
} }
id = this.textContent; id = this.textContent;
text = ">>" + id + "\n"; text = ">>" + id + "\n";

View File

@ -748,7 +748,6 @@ keybinds =
qr.quote.call $ '.quotejs + .quotejs', $('.replyhl', thread) or thread qr.quote.call $ '.quotejs + .quotejs', $('.replyhl', thread) or thread
else else
qr.open() qr.open()
qr.pickThread thread.firstChild.id unless g.REPLY
$('textarea', qr.el).focus() $('textarea', qr.el).focus()
open: (thread, tab) -> open: (thread, tab) ->
@ -959,13 +958,11 @@ qr =
qr.submit() if qr.cooldown.auto qr.submit() if qr.cooldown.auto
qr.status() qr.status()
pickThread: (thread) ->
$('select', qr.el).value = thread
quote: (e) -> quote: (e) ->
e?.preventDefault() e?.preventDefault()
qr.open() qr.open()
qr.pickThread $.x('ancestor::div[@class="thread"]/div', @).id unless g.REPLY unless g.REPLY
$('select', qr.el).value = $.x('ancestor::div[@class="thread"]/div', @).id
id = @textContent id = @textContent
text = ">>#{id}\n" text = ">>#{id}\n"