changeset 62:68b4c80e884f

focus on first input element of newly opened dialogs
author Atul Varma <avarma@mozilla.com>
date Sun, 25 Apr 2010 08:14:18 -0700
parents 0e50d4f77a77
children 88b856b1353b
files js/modules/app.js
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js/modules/app.js	Sun Apr 25 07:59:33 2010 -0700
+++ b/js/modules/app.js	Sun Apr 25 08:14:18 2010 -0700
@@ -180,7 +180,10 @@
       var dialog = $("#" + name);
       if (dialog.length == 0)
         throw new Error("dialog not found: " + name);
-      dialog.fadeIn();
+      dialog.fadeIn(
+        function() {
+          dialog.find("input:first").focus();
+        });
     });
 
   $(".dialog").click(