mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 18:52:14 +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')) {
|
if (model.get('id')) {
|
||||||
self.transitionToRoute('editor.edit', model);
|
self.transitionToRoute('editor.edit', model);
|
||||||
}
|
}
|
||||||
return model;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,12 @@ var PostController = Ember.ObjectController.extend({
|
|||||||
var featured = this.toggleProperty('featured'),
|
var featured = this.toggleProperty('featured'),
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
self.notifications.closePassive();
|
|
||||||
|
|
||||||
this.get('model').save().then(function () {
|
this.get('model').save().then(function () {
|
||||||
|
self.notifications.closePassive();
|
||||||
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
||||||
}).catch(function (errors) {
|
}).catch(function (errors) {
|
||||||
|
self.notifications.closePassive();
|
||||||
self.notifications.showErrors(errors);
|
self.notifications.showErrors(errors);
|
||||||
return Ember.RSVP.reject(errors);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,16 +30,14 @@ var SettingsGeneralController = Ember.ObjectController.extend({
|
|||||||
save: function () {
|
save: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.notifications.closePassive();
|
|
||||||
|
|
||||||
return this.get('model').save().then(function (model) {
|
return this.get('model').save().then(function (model) {
|
||||||
|
self.notifications.closePassive();
|
||||||
self.notifications.showSuccess('Settings successfully saved.');
|
self.notifications.showSuccess('Settings successfully saved.');
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}).catch(function (errors) {
|
}).catch(function (errors) {
|
||||||
|
self.notifications.closePassive();
|
||||||
self.notifications.showErrors(errors);
|
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 () {
|
this.validate({ format: false }).then(function () {
|
||||||
self.send('authenticate');
|
self.send('authenticate');
|
||||||
}).catch(function (errors) {
|
}).catch(function (errors) {
|
||||||
|
self.notifications.closePassive();
|
||||||
self.notifications.showErrors(errors);
|
self.notifications.showErrors(errors);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user