Ghost/ghost/admin/app/controllers/application.js

54 lines
1.1 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
2016-01-19 16:03:27 +03:00
const {
Controller,
computed,
inject: {service}
} = Ember;
export default Controller.extend({
2016-01-19 16:03:27 +03:00
dropdown: service(),
signedOut: computed.match('currentPath', /(signin|signup|setup|reset)/),
topNotificationCount: 0,
showMobileMenu: false,
showSettingsMenu: false,
showMarkdownHelpModal: 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);
}
}
});