Ghost/ghost/admin/routes/editor/new.js
Hannah Wolfe 0fa35b325c Merge pull request #4522 from felixrieseberg/iss4487
Dynamic Titles in Ghost Admin
2014-11-28 19:06:44 +00:00

31 lines
881 B
JavaScript

import AuthenticatedRoute from 'ghost/routes/authenticated';
import base from 'ghost/mixins/editor-base-route';
var EditorNewRoute = AuthenticatedRoute.extend(base, {
titleToken: 'Editor',
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');
// Ensure that the PSM Image Uploader resets
psm.send('resetUploader');
this._super(controller, model);
}
});
export default EditorNewRoute;