mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
01ac8a40ea
Refs #3834 - Change bindings and fix a forward reference. Preparation for upgrade to Ember 1.7.0.
25 lines
987 B
JavaScript
25 lines
987 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');
|
|
}),
|
|
|
|
'publishText': Ember.computed('controller.isPublished', function () {
|
|
return this.get('controller.isPublished') ? 'Update Post' : 'Publish Now';
|
|
}),
|
|
|
|
'draftText': Ember.computed('controller.isPublished', function () {
|
|
return this.get('controller.isPublished') ? 'Unpublish' : 'Save Draft';
|
|
}),
|
|
|
|
'saveText': Ember.computed('controller.willPublish', function () {
|
|
return this.get('controller.willPublish') ? this.get('publishText') : this.get('draftText');
|
|
}),
|
|
});
|
|
|
|
export default EditorSaveButtonView;
|