2014-10-28 08:29:42 -06:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-11-03 20:31:10 -07:00
|
|
|
import base from 'ghost/mixins/editor-base-route';
|
2014-03-09 23:44:08 -04:00
|
|
|
|
2014-10-28 08:29:42 -06:00
|
|
|
var EditorNewRoute = AuthenticatedRoute.extend(base, {
|
2014-05-21 07:53:00 -06:00
|
|
|
model: function () {
|
2014-07-16 23:54:32 -06:00
|
|
|
var self = this;
|
|
|
|
return this.get('session.user').then(function (user) {
|
|
|
|
return self.store.createRecord('post', {
|
|
|
|
author: user
|
|
|
|
});
|
|
|
|
});
|
2014-06-05 21:18:03 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function (controller, model) {
|
2014-10-25 23:29:58 +00:00
|
|
|
var psm = this.controllerFor('post-settings-menu');
|
|
|
|
|
|
|
|
// make sure there are no titleObserver functions hanging around
|
|
|
|
// from previous posts
|
|
|
|
psm.removeObserver('titleScratch', psm, 'titleObserver');
|
|
|
|
|
2014-11-03 20:31:10 -07:00
|
|
|
this._super(controller, model);
|
2014-03-09 23:44:08 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-09 22:44:29 -06:00
|
|
|
export default EditorNewRoute;
|