From f2641df0a930f921a21714269414fb2d8ab11cb0 Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Fri, 6 Jun 2014 23:05:04 -0600 Subject: [PATCH] Fixed publish button not updating with model change Closes #2908 - Changes `willPublish` from `oneWay` property to computed property. --- core/client/controllers/posts/post.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/client/controllers/posts/post.js b/core/client/controllers/posts/post.js index 7f8a9843e1..60a6c421c2 100644 --- a/core/client/controllers/posts/post.js +++ b/core/client/controllers/posts/post.js @@ -5,7 +5,17 @@ var PostController = Ember.ObjectController.extend({ //## Computed post properties isPublished: Ember.computed.equal('status', 'published'), isDraft: Ember.computed.equal('status', 'draft'), - willPublish: Ember.computed.oneWay('isPublished'), + /** + * By default, a post will not change its publish state. + * Only with a user-set value (via setSaveType action) + * can the post's status change. + */ + willPublish: function (key, val) { + if (val) { + return val; + } + return this.get('isPublished'); + }.property('isPublished'), isStaticPage: function (key, val) { var self = this;