From f6a642a52e05f44f7131dfd182e707d6f1fe6e7e Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Fri, 1 Feb 2013 13:42:50 +0100 Subject: give focus to the reply field when opened --- hyperkitty/static/js/hyperkitty.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hyperkitty/static/js/hyperkitty.js') diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js index 7e297f4..7464314 100644 --- a/hyperkitty/static/js/hyperkitty.js +++ b/hyperkitty/static/js/hyperkitty.js @@ -142,7 +142,11 @@ function setup_favorites() { function setup_replies() { $("a.reply").click(function(e) { e.preventDefault(); - $(this).next().slideToggle(); + $(this).next().slideToggle("fast", function() { + if ($(this).css("display") === "block") { + $(this).find("textarea").focus(); + } + }); }); $(".reply-form button[type='submit']").click(function(e) { e.preventDefault(); -- cgit