Permalink
Browse files

Merge pull request #2723 from mozilla/hotfix_2711_email_focus

Focus the #authentication_email field when first loading the dialog and the user is not authenticated.
  • Loading branch information...
2 parents 184b4fe + 9569f06 commit 3a4e8161d9ad9ed4e0b15ed327d709b4d9a62b52 @lloyd lloyd committed Nov 15, 2012
View
1 resources/static/dialog/js/modules/authenticate.js
@@ -138,6 +138,7 @@ BrowserID.Modules.Authenticate = (function() {
self.publish("enter_email");
self.submit = checkEmail;
showHint("start");
+ dom.focus(EMAIL_SELECTOR);
}
}
View
4 resources/static/test/cases/dialog/js/modules/authenticate.js
@@ -17,6 +17,7 @@
testHelpers = bid.TestHelpers,
testElementHasClass = testHelpers.testHasClass,
testElementNotHasClass = testHelpers.testNotHasClass,
+ testElementFocused = testHelpers.testElementFocused,
register = testHelpers.register,
provisioning = bid.Mocks.Provisioning,
AUTH_FORM_SELECTOR = "#authentication_form",
@@ -68,6 +69,9 @@
testElementHasClass(BODY_SELECTOR, AUTHENTICATION_CLASS);
equal($(CONTENTS_SELECTOR).text(), "", "normal form contents are removed");
+
+ testElementFocused("#authentication_email", "email field is focused");
+
// auth form not visible after stop;
controller.stop();
testElementNotHasClass(BODY_SELECTOR, AUTHENTICATION_CLASS);

0 comments on commit 3a4e816

Please sign in to comment.