diff --git a/static/scripts/app/views/invitation.js b/static/scripts/app/views/invitation.js index a882a9b167..b62ac326c4 100644 --- a/static/scripts/app/views/invitation.js +++ b/static/scripts/app/views/invitation.js @@ -21,9 +21,12 @@ define([ 'click .rm-invitation': 'removeInvitation' }, - removeInvitation: function() { + removeInvitation: function(e) { var _this = this; + var $el = $(e.currentTarget); + $el.hide(); // hide the icon to avoid being clicked repeatedly + $.ajax({ url: Common.getUrl({ 'name': 'invitation', @@ -37,6 +40,7 @@ define([ Common.feedback(gettext("Successfully deleted 1 item."), 'success'); }, error: function(xhr) { + $el.show(); Common.ajaxErrorHandler(xhr); } });