2014-06-09 23:44:29 -05:00
|
|
|
import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
|
|
|
|
|
2014-12-29 21:11:24 -05:00
|
|
|
var EditorNewController = Ember.Controller.extend(EditorControllerMixin, {
|
2014-06-11 16:36:54 -05:00
|
|
|
actions: {
|
|
|
|
/**
|
|
|
|
* Redirect to editor after the first save
|
|
|
|
*/
|
2014-10-08 09:53:20 -05:00
|
|
|
save: function (options) {
|
2014-06-11 16:36:54 -05:00
|
|
|
var self = this;
|
2014-10-08 09:53:20 -05:00
|
|
|
return this._super(options).then(function (model) {
|
2014-06-11 16:36:54 -05:00
|
|
|
if (model.get('id')) {
|
2014-10-18 06:16:43 -05:00
|
|
|
self.replaceRoute('editor.edit', model);
|
2014-06-11 16:36:54 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-06-09 23:44:29 -05:00
|
|
|
|
2014-06-05 20:18:03 -05:00
|
|
|
export default EditorNewController;
|