2014-03-03 15:18:10 -05:00
|
|
|
var PostController = Ember.ObjectController.extend({
|
2014-05-31 13:32:22 -05:00
|
|
|
isPublished: Ember.computed.equal('status', 'published'),
|
2014-06-16 00:44:07 -05:00
|
|
|
classNameBindings: ['featured'],
|
2014-05-21 08:53:00 -05:00
|
|
|
|
2014-04-20 09:48:34 -05:00
|
|
|
actions: {
|
2014-05-09 00:00:10 -05:00
|
|
|
toggleFeatured: function () {
|
2014-07-14 23:02:34 -05:00
|
|
|
var options = {disableNProgress: true},
|
2014-06-16 00:44:07 -05:00
|
|
|
self = this;
|
2014-05-09 00:00:10 -05:00
|
|
|
|
2014-07-14 23:02:34 -05:00
|
|
|
this.toggleProperty('featured');
|
|
|
|
this.get('model').save(options).catch(function (errors) {
|
2014-06-20 16:36:44 -05:00
|
|
|
self.notifications.showErrors(errors);
|
2014-06-16 00:44:07 -05:00
|
|
|
});
|
2014-04-20 09:48:34 -05:00
|
|
|
}
|
|
|
|
}
|
2014-03-03 15:18:10 -05:00
|
|
|
});
|
|
|
|
|
2014-06-29 16:45:03 -05:00
|
|
|
export default PostController;
|