mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
b5af691a61
Closes #4369 - Renamed `editor-route-base` -> `editor-base-route` to bring it in alignment with the view and controller mixins - Consolidated editor route code into editor-base-route - Removed `serialize` from EditorEditRoute, as it reimplemented the ember default
25 lines
765 B
JavaScript
25 lines
765 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import base from 'ghost/mixins/editor-base-route';
|
|
|
|
var EditorNewRoute = AuthenticatedRoute.extend(base, {
|
|
model: function () {
|
|
var self = this;
|
|
return this.get('session.user').then(function (user) {
|
|
return self.store.createRecord('post', {
|
|
author: user
|
|
});
|
|
});
|
|
},
|
|
|
|
setupController: function (controller, model) {
|
|
var psm = this.controllerFor('post-settings-menu');
|
|
|
|
// make sure there are no titleObserver functions hanging around
|
|
// from previous posts
|
|
psm.removeObserver('titleScratch', psm, 'titleObserver');
|
|
|
|
this._super(controller, model);
|
|
}
|
|
});
|
|
|
|
export default EditorNewRoute;
|