diff --git a/resources/static/dialog/controllers/add_email.js b/resources/static/dialog/controllers/add_email.js index c9a8c638ca85ddc7f7566fb1c80e8dd90fa85d89..da642e0d2ced87d3cdf769b0d2389e0b2ad46e9a 100644 --- a/resources/static/dialog/controllers/add_email.js +++ b/resources/static/dialog/controllers/add_email.js @@ -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); diff --git a/resources/static/dialog/views/add_email.ejs b/resources/static/dialog/views/add_email.ejs index 5af78c55bba4147120393579d08484e2be5ebbb2..9e183be4c20c66d881def28e9617382b19731f1a 100644 --- a/resources/static/dialog/views/add_email.ejs +++ b/resources/static/dialog/views/add_email.ejs @@ -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">