Ghost/core/client/app/controllers/application.js

49 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
2015-05-24 08:47:23 +03:00
const {Controller, computed, inject} = Ember;
export default Controller.extend({
dropdown: inject.service(),
signedOut: computed.match('currentPath', /(signin|signup|setup|reset)/),
topNotificationCount: 0,
showMobileMenu: false,
showSettingsMenu: false,
2015-05-24 08:47:23 +03:00
autoNav: false,
autoNavOpen: computed('autoNav', {
get() {
return false;
},
set(key, value) {
if (this.get('autoNav')) {
return value;
}
return false;
}
}),
actions: {
topNotificationChange(count) {
this.set('topNotificationCount', count);
2015-05-24 08:47:23 +03:00
},
toggleAutoNav() {
this.toggleProperty('autoNav');
},
openAutoNav() {
this.set('autoNavOpen', true);
2015-05-24 08:47:23 +03:00
},
closeAutoNav() {
this.set('autoNavOpen', false);
},
closeMobileMenu() {
this.set('showMobileMenu', false);
}
}
});