diff --git a/core/client/controllers/modals/invite-new-user.js b/core/client/controllers/modals/invite-new-user.js index 2c55f6fdcf..18e3c058f2 100644 --- a/core/client/controllers/modals/invite-new-user.js +++ b/core/client/controllers/modals/invite-new-user.js @@ -6,6 +6,7 @@ var InviteNewUserController = Ember.Controller.extend({ var authorRole = roles.findBy('name', 'Author'); //Initialize role as well. self.set('role', authorRole); + self.set('authorRole', authorRole); return authorRole; }); }), @@ -51,10 +52,14 @@ var InviteNewUserController = Ember.Controller.extend({ newUser.deleteRecord(); self.notifications.closePassive(); self.notifications.showErrors(errors); + }).finally(function () { + //Reset + self.set('email', ''); + self.set('role', self.get('authorRole')); + //Make sure the modal closes on confirm, no matter the + //method used to close it (enter in input vs Confirm click) + self.send('closeModal'); }); - - self.set('email', null); - self.set('role', null); }, confirmReject: function () { diff --git a/core/client/templates/modals/invite-new-user.hbs b/core/client/templates/modals/invite-new-user.hbs index 19a7ac2940..0a891f41a8 100644 --- a/core/client/templates/modals/invite-new-user.hbs +++ b/core/client/templates/modals/invite-new-user.hbs @@ -4,7 +4,7 @@