mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Fixed publish button not updating with model change
Closes #2908 - Changes `willPublish` from `oneWay` property to computed property.
This commit is contained in:
parent
b7aca05d95
commit
f2641df0a9
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user