mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
c3ad1ae9e2
No Issue - Switches to the newer style of dependency injection. - Instead of injection Controllers via "needs," use Ember.inject.controller(). - Get rid of initializers that were only injecting objects into various factories. Converts these objects into Ember.Service objects and declaratively inject them where needed via Ember.inject.service(). The added benefit to this is that it's no longer a mystery where these properties/methods come from and it's straightforward to inject them where needed.
31 lines
719 B
JavaScript
31 lines
719 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Controller.extend({
|
|
dropdown: Ember.inject.service(),
|
|
|
|
// jscs: disable
|
|
signedOut: Ember.computed.match('currentPath', /(signin|signup|setup|reset)/),
|
|
// jscs: enable
|
|
|
|
topNotificationCount: 0,
|
|
showNavMenu: false,
|
|
showSettingsMenu: false,
|
|
|
|
autoNav: false,
|
|
|
|
actions: {
|
|
topNotificationChange: function (count) {
|
|
this.set('topNotificationCount', count);
|
|
},
|
|
|
|
closeNavMenu: function () {
|
|
this.get('dropdown').closeDropdowns();
|
|
this.set('showNavMenu', false);
|
|
},
|
|
|
|
navMenuToggleMaximise: function () {
|
|
this.toggleProperty('autoNav');
|
|
}
|
|
}
|
|
});
|