Skip to content
Snippets Groups Projects
Commit 625563d7 authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Make the "is this your computer" screen keyboard navigable.

* For the buttons, use id's instead of classes.
* Focus the "yes" button when the screen is shown.

issue #1582
parent 206461bd
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ BrowserID.Modules.IsThisYourComputer = (function() { ...@@ -7,6 +7,7 @@ BrowserID.Modules.IsThisYourComputer = (function() {
"use strict"; "use strict";
var bid = BrowserID, var bid = BrowserID,
dom = bid.DOM,
user = bid.User, user = bid.User,
errors = bid.Errors, errors = bid.Errors,
email; email;
...@@ -20,9 +21,12 @@ BrowserID.Modules.IsThisYourComputer = (function() { ...@@ -20,9 +21,12 @@ BrowserID.Modules.IsThisYourComputer = (function() {
self.renderWait("is_this_your_computer", options); self.renderWait("is_this_your_computer", options);
// TODO - Make the selectors use ids instead of classes. // renderWait does not automatically focus the first input element or
self.click("button.this_is_my_computer", self.yes); // button, so it must be done manually.
self.click("button.this_is_not_my_computer", self.no); dom.focus("#this_is_my_computer");
self.click("#this_is_my_computer", self.yes);
self.click("#this_is_not_my_computer", self.no);
Module.sc.start.call(self, options); Module.sc.start.call(self, options);
}, },
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
<h2><%= gettext('If you don\'t mind me asking, is this your computer?') %></h2> <h2><%= gettext('If you don\'t mind me asking, is this your computer?') %></h2>
<p> <p>
<button class="this_is_my_computer" tabindex="3"><%= gettext('yes') %></button> <button id="this_is_my_computer"><%= gettext('yes') %></button>
<%= gettext('If so, we\'ll keep you logged in for a couple weeks.') %> <%= gettext('If so, we\'ll keep you logged in for a couple weeks.') %>
</p> </p>
<p> <p>
<button class="this_is_not_my_computer negative" tabindex="3"><%= gettext('no') %></button> <button id="this_is_not_my_computer" class="negative"><%= gettext('no') %></button>
<%= gettext('If you\'re at a public computer such as a library or internet cafe, we\'ll ask you for your password again in an hour.') %> <%= gettext('If you\'re at a public computer such as a library or internet cafe, we\'ll ask you for your password again in an hour.') %>
</p> </p>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment