2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
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, {
|
2015-04-11 18:44:25 +03:00
|
|
|
// Overriding autoSave on the base controller, as the new controller shouldn't be autosaving
|
|
|
|
autoSave: Ember.K,
|
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;
|