Ghost/ghost/admin/controllers/editor/new.js
Robert Jackson d8da21520f Remove ObjectController proxying behavior.
Ember.ObjectController (and Ember.ArrayController) will be deprecated in
Ember 1.11 (and removed from core in Ember 2.0). The reasoning is
detailed in the Ember 2.0 RFC.

This PR does the following:

* Updates templates/controllers/views to explicitly reference model
  properties (instead of relying on proxying behavior).
* Clearly delineate where certain properties are being set or retrieved
  from (for example it was not clear exactly where `scratch` and
  `titleScratch` were stored).
* Remove usage of `Ember.ObjectController`.
* Add JSCS rule to prevent future PR's from adding regressions.
2015-01-01 21:51:20 -05:00

20 lines
560 B
JavaScript

import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.Controller.extend(EditorControllerMixin, {
actions: {
/**
* Redirect to editor after the first save
*/
save: function (options) {
var self = this;
return this._super(options).then(function (model) {
if (model.get('id')) {
self.replaceRoute('editor.edit', model);
}
});
}
}
});
export default EditorNewController;