2014-06-09 23:44:29 -05:00
|
|
|
import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
|
|
|
|
|
2014-06-21 13:58:06 -05:00
|
|
|
var EditorNewController = Ember.ObjectController.extend(EditorControllerMixin, {
|
2014-06-11 16:36:54 -05: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 12:22:15 -05:00
|
|
|
self.transitionToRoute('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;
|