Ghost/core/client/routes/settings/index.js
Matt Enlow 3667fa9885 Add relationships to client models
No issue
- Removed tabs from tag.js (why didn't jshint catch this?)
- Removed superfluous `activate` in SettingsIndexRoute
- updated `UserModel` and `TagModel` to have `created_by, updated_by` be references to `user` objects.
- updated `UserModel` to use `moment-date` instead of `date`
2014-07-21 08:01:59 -06:00

30 lines
1014 B
JavaScript

import {mobileQuery} from 'ghost/utils/mobile';
var SettingsIndexRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, {
// redirect to general tab, unless on a mobile phone
beforeModel: function () {
if (!mobileQuery.matches) {
this.transitionTo('settings.general');
} else {
//fill the empty {{outlet}} in settings.hbs if the user
//goes to fullscreen
//fillOutlet needs special treatment so that it is
//properly bound to this when called from a MQ event
this.set('fillOutlet', _.bind(function fillOutlet(mq) {
if (!mq.matches) {
this.transitionTo('settings.general');
}
}, this));
mobileQuery.addListener(this.fillOutlet);
}
},
deactivate: function () {
if (this.get('fillOutlet')) {
mobileQuery.removeListener(this.fillOutlet);
}
}
});
export default SettingsIndexRoute;