From 3c10a6bf94d26df1b5f22719b3be609177fe52a6 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 18 May 2012 11:08:27 -0600 Subject: [PATCH] Set focus when toggling comment window. --- lib/gollum/frontend/public/gollum/livepreview/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/index.html b/lib/gollum/frontend/public/gollum/livepreview/index.html index f35e6471..03d38a8f 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/index.html +++ b/lib/gollum/frontend/public/gollum/livepreview/index.html @@ -133,7 +133,11 @@ window.onload = function() { // Hide dimmer, comment tool panel, and comment. $("#commentcancel").click(function() { + // Restore focus on commentcancel but not on + // savecommentconfirm because the latter loads + // a new page. hideCommentWindow(); + editor.focus(); }); var isCommentHidden = true; @@ -150,7 +154,9 @@ window.onload = function() { isCommentHidden = false; darkness.style.visibility = "visible"; commentToolPanel.style.visibility = "visible"; - comment.style.visibility = "visible"; + comment.style.visibility = "visible"; + // Set focus so typing can begin immediately. + commentEditor.focus(); }); $("#savecommentconfirm").click(function() {