Permalink
Browse files

Focus the first input element on screen show.

Very useful for usability.

issue #92
  • Loading branch information...
1 parent 7f1a822 commit 0239e4ba0b675244f533a9d314457a05154461ea @shane-tomlinson shane-tomlinson committed Jul 20, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 browserid/static/dialog/controllers/dialog_controller.js
@@ -43,7 +43,9 @@ $.Controller("Dialog", {}, {
renderTemplates: function(body, body_vars, footer, footer_vars) {
if (body) {
var bodyHtml = $.View("//dialog/views/" + body, body_vars);
- $('#dialog').html(bodyHtml).hide().fadeIn(300);
+ $('#dialog').html(bodyHtml).hide().fadeIn(300, function() {
+ $('#dialog input').eq(0).focus();
+ });
}
if (footer) {

0 comments on commit 0239e4b

Please sign in to comment.