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

49 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
export default Ember.Controller.extend({
dropdown: Ember.inject.service(),
// jscs: disable
2015-05-22 06:47:51 +03:00
signedOut: Ember.computed.match('currentPath', /(signin|signup|setup|reset)/),
// jscs: enable
topNotificationCount: 0,
showMobileMenu: false,
showSettingsMenu: false,
2015-05-24 08:47:23 +03:00
autoNav: false,
autoNavOpen: Ember.computed('autoNav', {
get: function () {
return false;
},
set: function (key, value) {
if (this.get('autoNav')) {
return value;
}
return false;
}
}),
actions: {
topNotificationChange: function (count) {
this.set('topNotificationCount', count);
2015-05-24 08:47:23 +03:00
},
toggleAutoNav: function () {
this.toggleProperty('autoNav');
},
openAutoNav: function () {
this.set('autoNavOpen', true);
2015-05-24 08:47:23 +03:00
},
closeAutoNav: function () {
this.set('autoNavOpen', false);
},
closeMobileMenu: function () {
this.set('showMobileMenu', false);
}
}
});