diff --git a/ghost/admin/controllers/editor/new.js b/ghost/admin/controllers/editor/new.js index 0c5d6a07ca..13f246f69a 100644 --- a/ghost/admin/controllers/editor/new.js +++ b/ghost/admin/controllers/editor/new.js @@ -1,5 +1,20 @@ import EditorControllerMixin from 'ghost/mixins/editor-base-controller'; -var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin); +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; +export default EditorNewController; \ No newline at end of file diff --git a/ghost/admin/mixins/editor-base-controller.js b/ghost/admin/mixins/editor-base-controller.js index f06722dc79..8f9ff061ff 100644 --- a/ghost/admin/mixins/editor-base-controller.js +++ b/ghost/admin/mixins/editor-base-controller.js @@ -22,10 +22,10 @@ var EditorControllerMixin = Ember.Mixin.create({ self = this; this.set('status', status); - this.get('model').save().then(function () { - console.log('saved'); + return this.get('model').save().then(function (model) { self.notifications.showSuccess('Post status saved as ' + - self.get('status') + '.'); + model.get('status') + '.'); + return model; }, this.notifications.showErrors); },