Ghost/ghost/admin/controllers/editor/new.js

20 lines
574 B
JavaScript
Raw Normal View History

import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
actions: {
/**
* Redirect to editor after the first save
*/
save: function () {
var self = this;
this._super().then(function (model) {
if (model.get('id')) {
self.transitionTo('editor.edit', model);
}
return model;
});
}
}
});
export default EditorNewController;