Ghost/ghost/admin/app/services/ui.js
Kevin Ansfield 5e3de1c333 🎨 Removed auto hide/show navigation toggle (#1094)
no issue
- the autonav behaviour has outlasted it's usefulness - it was mostly useful for editing but the editor screen is now always fullscreen and the number of low-resolution screens has dropped significantly
- dropped the components and all supporting code associated with autonav behaviour
2019-01-10 15:00:07 +00:00

54 lines
1.1 KiB
JavaScript

import Service, {inject as service} from '@ember/service';
import {not, or, reads} from '@ember/object/computed';
export default Service.extend({
dropdown: service(),
mediaQueries: service(),
isFullScreen: false,
showMobileMenu: false,
showSettingsMenu: false,
hasSideNav: not('isSideNavHidden'),
isMobile: reads('mediaQueries.isMobile'),
isSideNavHidden: or('isFullScreen', 'isMobile'),
closeMenus() {
this.get('dropdown').closeDropdowns();
this.setProperties({
showSettingsMenu: false,
showMobileMenu: false
});
},
closeMobileMenu() {
this.set('showMobileMenu', false);
},
openMobileMenu() {
this.set('showMobileMenu', true);
},
openSettingsMenu() {
this.set('showSettingsMenu', true);
},
actions: {
closeMenus() {
this.closeMenus();
},
closeMobileMenu() {
this.closeMobileMenu();
},
openMobileMenu() {
this.openMobileMenu();
},
openSettingsMenu() {
this.openSettingsMenu();
}
}
});