Skip to content
Snippets Groups Projects
Commit 99649fb1 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

merge fix for selecting email addresses by clicking on label in iOS into dev -...

merge fix for selecting email addresses by clicking on label in iOS into dev - closes #1133 closes #1137
parents 0d541790 4341c359
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,13 @@ BrowserID.Modules.PickEmail = (function() {
return identities;
}
function selectEmail(event) {
var target = dom.getAttr(event.currentTarget, "for");
if(target) {
dom.setAttr("#" + target, "checked", "checked");
}
}
var Module = bid.Modules.PageModule.extend({
start: function(options) {
var origin = user.getOrigin(),
......@@ -91,6 +98,7 @@ BrowserID.Modules.PickEmail = (function() {
}
self.bind("#useNewEmail", "click", cancelEvent(addEmail));
self.bind("#selectEmail label", "click", selectEmail);
sc.start.call(self, options);
......
......@@ -155,5 +155,17 @@
controller.addEmail();
});
test("click on an email label - select corresponding radio button", function() {
storage.addEmail("testuser@testuser.com", {});
storage.addEmail("testuser2@testuser.com", {});
createController(false);
equal($("#testuser_testuser_com").is(":checked"), false, "radio button is not selected before click.");
$("label[for=testuser_testuser_com]").trigger("click");
equal($("#testuser_testuser_com").is(":checked"), true, "radio button is correctly selected");
});
}());
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