Ghost/ghost/admin/app/components/gh-content-cover.js

31 lines
533 B
JavaScript
Raw Normal View History

/*
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(),
2015-05-24 08:47:23 +03:00
classNames: ['content-cover'],
onMouseEnter: null,
click() {
this.get('ui').closeMenus();
2015-05-24 08:47:23 +03:00
},
mouseEnter() {
this.get('ui').closeAutoNav();
2015-05-24 08:47:23 +03:00
}
});