mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
20f40e7e32
Closes #3417
24 lines
988 B
JavaScript
24 lines
988 B
JavaScript
var EditorSaveButtonView = Ember.View.extend({
|
|
templateName: 'editor-save-button',
|
|
tagName: 'section',
|
|
classNames: ['splitbtn js-publish-splitbutton'],
|
|
|
|
//Tracks whether we're going to change the state of the post on save
|
|
isDangerous: Ember.computed('controller.isPublished', 'controller.willPublish', function () {
|
|
return this.get('controller.isPublished') !== this.get('controller.willPublish');
|
|
}),
|
|
|
|
'save-text': Ember.computed('controller.willPublish', function () {
|
|
return this.get('controller.willPublish') ? this.get('publish-text') : this.get('draft-text');
|
|
}),
|
|
|
|
'publish-text': Ember.computed('controller.isPublished', function () {
|
|
return this.get('controller.isPublished') ? 'Update Post' : 'Publish Now';
|
|
}),
|
|
|
|
'draft-text': Ember.computed('controller.isPublished', function () {
|
|
return this.get('controller.isPublished') ? 'Unpublish' : 'Save Draft';
|
|
})
|
|
});
|
|
|
|
export default EditorSaveButtonView;
|