diff js/modules/app.js @ 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 07d3d1560b93
children 88b856b1353b
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(