mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
24 lines
658 B
JavaScript
24 lines
658 B
JavaScript
import Controller from 'ember-controller';
|
|
import EditorControllerMixin from 'ghost-admin/mixins/editor-base-controller';
|
|
|
|
function K() {
|
|
return this;
|
|
}
|
|
|
|
export default Controller.extend(EditorControllerMixin, {
|
|
// Overriding autoSave on the base controller, as the new controller shouldn't be autosaving
|
|
autoSave: K,
|
|
actions: {
|
|
/**
|
|
* Redirect to editor after the first save
|
|
*/
|
|
save(options) {
|
|
return this._super(options).then((model) => {
|
|
if (model.get('id')) {
|
|
this.replaceRoute('editor.edit', model);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|