mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
b04dfd52c1
No issue Misc Places - Removed expired, irrelevant, and fixed todos FloatingHeaderPartial - Fixed "Written" vs "Published" text logic SettingsGeneralController - Removed single quotes from property names EditorBaseController, MarkerManagerMixin - Aligned var declarations PostItemView - Commented out unfunctional code for feature request #2398 - Switched `isPage`, `isFeatured` to be computed properties in `Po - use `toggleProperty` in `PostController.action.toggleFeatured`
19 lines
No EOL
672 B
JavaScript
19 lines
No EOL
672 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;
|
|
|
|
this.get('model').save().then(function () {
|
|
self.notifications.showSuccess('Post successfully marked as ' + (featured ? 'featured' : 'not featured') + '.');
|
|
}).catch(function () {
|
|
self.notifications.showError('An error occured while saving the post.');
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
export default PostController; |