mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
267ce40945
no issue - moves general UI state control such as menu display, autonav, settings menu, etc into a `ui` service for easier use within components - no longer required to jump through hoops passing state and actions down from application controller into components - removes indirect "route" actions in favour of calling actions/methods directly on the `ui` service
31 lines
532 B
JavaScript
31 lines
532 B
JavaScript
/*
|
|
|
|
Implements a div for covering the page content
|
|
when in a menu context that, for example,
|
|
should be closed when the user clicks elsewhere.
|
|
|
|
Example:
|
|
```
|
|
{{gh-content-cover}}
|
|
```
|
|
**/
|
|
|
|
import Component from 'ember-component';
|
|
import {inject as injectService} from '@ember/service';
|
|
|
|
export default Component.extend({
|
|
ui: injectService(),
|
|
|
|
classNames: ['content-cover'],
|
|
|
|
onMouseEnter: null,
|
|
|
|
click() {
|
|
this.get('ui').closeMenus();
|
|
},
|
|
|
|
mouseEnter() {
|
|
this.get('ui').closeAutoNav();
|
|
}
|
|
});
|