mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #3706 from jaswilli/invite-fixup
Close invite user modal immediately after submit.
This commit is contained in:
commit
d6b62501c0
1 changed files with 6 additions and 7 deletions
|
@ -24,12 +24,18 @@ var InviteNewUserController = Ember.Controller.extend({
|
|||
setRole: function (role) {
|
||||
this.set('role', role);
|
||||
},
|
||||
|
||||
confirmAccept: function () {
|
||||
var email = this.get('email'),
|
||||
role = this.get('role'),
|
||||
self = this,
|
||||
newUser;
|
||||
|
||||
// reset the form and close the modal
|
||||
self.set('email', '');
|
||||
self.set('role', self.get('authorRole'));
|
||||
self.send('closeModal');
|
||||
|
||||
newUser = self.store.createRecord('user', {
|
||||
email: email,
|
||||
status: 'invited',
|
||||
|
@ -49,13 +55,6 @@ var InviteNewUserController = Ember.Controller.extend({
|
|||
}).catch(function (errors) {
|
||||
newUser.deleteRecord();
|
||||
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');
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue