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

Merge pull request #1810 from seanmonstar/1433-add-email-notification

add notification to add_email dialog after submit

Nice work on this Sean.  In the near future, we may want to create generic helper functions or move the show/hideHint into PageModule.

r+

close #1433
parents dc776ef2 01c5fc92
No related branches found
No related tags found
No related merge requests found
......@@ -7,17 +7,38 @@ BrowserID.Modules.AddEmail = (function() {
"use strict";
var bid = BrowserID,
dom = bid.DOM,
helpers = bid.Helpers,
dialogHelpers = helpers.Dialog,
errors = bid.Errors,
complete = helpers.complete,
tooltip = bid.Tooltip;
tooltip = bid.Tooltip,
hints = ["addressInfo"],
ANIMATION_TIME = 250;
function hideHint(selector) {
$("." + selector).hide();
}
function showHint(selector, callback) {
_.each(hints, function(className) {
if (className !== selector) {
hideHint(className);
}
});
$("." + selector).fadeIn(ANIMATION_TIME, function() {
dom.fireEvent(window, "resize");
complete(callback);
});
}
function addEmail(callback) {
var email = helpers.getAndValidateEmail("#newEmail"),
self=this;
if (email) {
showHint("addressInfo");
dialogHelpers.addEmail.call(self, email, callback);
}
else {
......@@ -39,6 +60,7 @@ BrowserID.Modules.AddEmail = (function() {
});
self.renderDialog("add_email", templateData);
hideHint("addressInfo");
self.click("#cancel", cancelAddEmail);
Module.sc.start.call(self, options);
......
......@@ -27,6 +27,10 @@
<%= gettext('That address is already added to your account!') %>
</div>
</li>
<li id="hint_section" class="addressInfo">
<%= gettext("Please hold on while we get information about your email provider.") %>
</li>
</ul>
<div class="submit cf">
......
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