mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 05:21:36 +03:00
6deb206e84
- Toggles page class when post is marked as static/non-static
22 lines
702 B
JavaScript
22 lines
702 B
JavaScript
var PostController = Ember.ObjectController.extend({
|
|
isPublished: Ember.computed.equal('status', 'published'),
|
|
classNameBindings: ['featured'],
|
|
|
|
actions: {
|
|
toggleFeatured: function () {
|
|
var featured = !this.get('featured'),
|
|
self = this;
|
|
|
|
this.set('featured', featured);
|
|
|
|
this.get('model').save().then(function () {
|
|
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
|
}, function () {
|
|
self.notifications.showError('An error occured while saving the post.');
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
export default PostController;
|