From 01857d176a2a9a2e3816b9cbf32da0c58f6aac3d Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 19 Sep 2013 14:42:54 +1000 Subject: focus on quick reply textarea --- js/quick-reply.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'js/quick-reply.js') 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); }); } }); -- cgit v1.3 From 763f28f07ce2d514ce8f6aef036c95e2b70e7f5c Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 21 Sep 2013 21:47:44 +1000 Subject: "Post looks automated" bug --- js/quick-reply.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/quick-reply.js') diff --git a/js/quick-reply.js b/js/quick-reply.js index d60a3a82..6ef6815d 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -375,8 +375,8 @@ // 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); + var tmp = $('#quick-reply textarea[name="body"]').val(); + $('#quick-reply textarea[name="body"]').val('').focus().val(tmp); }, 1); }); } -- cgit v1.3