This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Focus the #authentication_email field when first loading the dialog a…

…nd the user is not authenticated.
  • Loading branch information...
shane-tomlinson committed Nov 15, 2012
1 parent 3cfa4d1 commit 9569f069bc1fb7030f05ae2b3b5769d3d9cd6eff
@@ -138,6 +138,7 @@ BrowserID.Modules.Authenticate = (function() {
self.publish("enter_email");
self.submit = checkEmail;
showHint("start");
+ dom.focus(EMAIL_SELECTOR);
}
}
@@ -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 9569f06

Please sign in to comment.