mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
3667fa9885
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`
30 lines
1014 B
JavaScript
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;
|