2014-06-10 08:44:29 +04:00
|
|
|
import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
|
|
|
|
|
2014-06-21 22:58:06 +04:00
|
|
|
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
|
2014-06-12 01:36:54 +04:00
|
|
|
actions: {
|
|
|
|
/**
|
|
|
|
* Redirect to editor after the first save
|
|
|
|
*/
|
|
|
|
save: function () {
|
|
|
|
var self = this;
|
|
|
|
this._super().then(function (model) {
|
|
|
|
if (model.get('id')) {
|
2014-06-21 21:22:15 +04:00
|
|
|
self.transitionToRoute('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;
|