mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Merge pull request #3181 from jaswilli/ember-misc
Prevent stacking notifications during rapid toggle
This commit is contained in:
commit
4043f7dfcb
@ -11,7 +11,6 @@ var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
|
||||
if (model.get('id')) {
|
||||
self.transitionToRoute('editor.edit', model);
|
||||
}
|
||||
return model;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -7,13 +7,12 @@ var PostController = Ember.ObjectController.extend({
|
||||
var featured = this.toggleProperty('featured'),
|
||||
self = this;
|
||||
|
||||
self.notifications.closePassive();
|
||||
|
||||
this.get('model').save().then(function () {
|
||||
self.notifications.closePassive();
|
||||
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
||||
}).catch(function (errors) {
|
||||
self.notifications.closePassive();
|
||||
self.notifications.showErrors(errors);
|
||||
return Ember.RSVP.reject(errors);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -30,16 +30,14 @@ var SettingsGeneralController = Ember.ObjectController.extend({
|
||||
save: function () {
|
||||
var self = this;
|
||||
|
||||
self.notifications.closePassive();
|
||||
|
||||
return this.get('model').save().then(function (model) {
|
||||
self.notifications.closePassive();
|
||||
self.notifications.showSuccess('Settings successfully saved.');
|
||||
|
||||
return model;
|
||||
}).catch(function (errors) {
|
||||
self.notifications.closePassive();
|
||||
self.notifications.showErrors(errors);
|
||||
|
||||
return Ember.RSVP.reject(errors);
|
||||
});
|
||||
},
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ var SigninController = Ember.Controller.extend(Ember.SimpleAuth.LoginControllerM
|
||||
this.validate({ format: false }).then(function () {
|
||||
self.send('authenticate');
|
||||
}).catch(function (errors) {
|
||||
self.notifications.closePassive();
|
||||
self.notifications.showErrors(errors);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user