mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
7e2e8b3376
closes #3057 - add Notification model - update injected Notifications object to handle persistent notifications - load server notifications on setup if logged in otherwise on successful sign-in - changed all existing notifications.closeAll calls to closePassive - fixed dismissable/dismissible spelling in server API & tests - add notifications.closeNotification method so DELETE calls can be made for server-originating notifications
23 lines
743 B
JavaScript
23 lines
743 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;
|
|
|
|
self.notifications.closePassive();
|
|
|
|
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;
|