diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 14:42:54 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-19 14:42:54 +1000 |
| commit | 01857d176a2a9a2e3816b9cbf32da0c58f6aac3d (patch) | |
| tree | b3b78bd7080d2a3508521604898b168e798cd383 /js/quick-reply.js | |
| parent | 8a5d6b1d3f2d9ce8177c240f78b9b1801bc7306c (diff) | |
focus on quick reply textarea
Diffstat (limited to 'js/quick-reply.js')
| -rw-r--r-- | js/quick-reply.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js index 91c35222..d60a3a82 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -365,13 +365,19 @@ if ($(this).width() <= 800) return; show_quick_reply(); - $('#quick-reply textarea').focus(); if (with_link) { - $(window).ready(function() { + $(document).ready(function() { if ($('#' + id).length) { highlightReply(id); - $(window).scrollTop($('#' + id).offset().top); + $(document).scrollTop($('#' + id).offset().top); } + + // Honestly, I'm not sure why we need setTimeout() here, but it seems to work. + // Same for the "tmp" variable stuff you see inside here: + setTimeout(function() { + var tmp = $('#quick-reply textarea').val(); + $('#quick-reply textarea').val('').focus().val(tmp); + }, 1); }); } }); |
