mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #2909 from novaugust/publish-button-reset
Fixed publish button not updating with model change
This commit is contained in:
commit
fccb5eaf26
1 changed files with 11 additions and 1 deletions
|
@ -5,7 +5,17 @@ var PostController = Ember.ObjectController.extend({
|
||||||
//## Computed post properties
|
//## Computed post properties
|
||||||
isPublished: Ember.computed.equal('status', 'published'),
|
isPublished: Ember.computed.equal('status', 'published'),
|
||||||
isDraft: Ember.computed.equal('status', 'draft'),
|
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) {
|
isStaticPage: function (key, val) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue