added loader to webfinger function

pull/1033/head
Justin Richer 2016-02-12 17:31:05 -05:00
parent 65e5476c66
commit fc38a9f65d
1 changed files with 10 additions and 1 deletions

View File

@ -450,6 +450,11 @@ var PolicyFormView = Backbone.View.extend({
var email = $('#email', this.el).val();
$('#loadingbox').sheet('show');
$('#loading').html(
'Looking up identity provider...'
);
var base = $('base').attr('href');
$.getJSON(base + '/api/emailsearch?' + $.param({'identifier': email}), function(data) {
@ -463,9 +468,13 @@ var PolicyFormView = Backbone.View.extend({
_self.render();
$('#loadingbox').sheet('hide');
}).error(function(jqXHR, textStatus, errorThrown) {
console.log("An error occurred when doing a webfinger lookup", errorThrown);
$('#loadingbox').sheet('hide');
//Display an alert with an error message
$('#modalAlert div.modal-header').html($.t('policy.webfinger-error'));
$('#modalAlert div.modal-body').html($.t('policy.webfinger-error-description', {email: email}));