mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
1af5eb6248
fixes #3105, refs #3012 - Add additional closeAll() calls where users interact with data
23 lines
No EOL
839 B
JavaScript
23 lines
No EOL
839 B
JavaScript
var PostController = Ember.ObjectController.extend({
|
|
isPublished: Ember.computed.equal('status', 'published'),
|
|
classNameBindings: ['featured'],
|
|
|
|
actions: {
|
|
toggleFeatured: function () {
|
|
var featured = this.toggleProperty('featured'),
|
|
self = this;
|
|
|
|
// @TODO This should call closePassive() to only close passive notifications
|
|
self.notifications.closeAll();
|
|
|
|
this.get('model').save().then(function () {
|
|
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
|
}).catch(function (errors) {
|
|
self.notifications.showErrors(errors);
|
|
return Ember.RSVP.reject(errors);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
export default PostController; |