mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-16 12:16:09 +03:00
f80f2e1a24
Closes #3105, Closes #3175 - Removed notification on successful post's `page` status change - Removed notification on successful post `featured` status change - Added `closePassive()` notifications on error in the post-settings-menu - Persistent notifications will close whether their `DELETE` request was successful or not. #### Misc - Added `name` attribute to `post-setting-menu.hbs` inputs to facilitate testing - Removed `return <Promise>` from action in `PostSettingsMenuController`. Actions should only return `true` - Toggling `post.featured` won't fire NProgress.
20 lines
577 B
JavaScript
20 lines
577 B
JavaScript
var PostController = Ember.ObjectController.extend({
|
|
isPublished: Ember.computed.equal('status', 'published'),
|
|
classNameBindings: ['featured'],
|
|
|
|
actions: {
|
|
toggleFeatured: function () {
|
|
var options = {disableNProgress: true},
|
|
self = this;
|
|
|
|
this.toggleProperty('featured');
|
|
this.get('model').save(options).catch(function (errors) {
|
|
self.notifications.closePassive();
|
|
self.notifications.showErrors(errors);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
export default PostController;
|