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