mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
25f692cdf6
Closes #2860 - `editor-base-controller`'s `save` action returns a promise with the model after saving - `EditorNewController` will transition to `EditorEditController` upon a successful save (model has an id) - Removed a console.log in editor's save function
20 lines
574 B
JavaScript
20 lines
574 B
JavaScript
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; |