2015-05-27 16:39:56 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
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 onClick="closeMenus" onMouseEnter="closeAutoNav"}}
|
|
|
|
```
|
|
|
|
**/
|
|
|
|
|
2015-05-24 00:47:23 -05:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
const {Component} = Ember;
|
|
|
|
|
|
|
|
export default Component.extend({
|
2015-05-24 00:47:23 -05:00
|
|
|
classNames: ['content-cover'],
|
|
|
|
|
|
|
|
onClick: null,
|
|
|
|
onMouseEnter: null,
|
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
click() {
|
2015-05-24 00:47:23 -05:00
|
|
|
this.sendAction('onClick');
|
|
|
|
},
|
|
|
|
|
2015-10-28 11:36:45 +00:00
|
|
|
mouseEnter() {
|
2015-05-24 00:47:23 -05:00
|
|
|
this.sendAction('onMouseEnter');
|
|
|
|
}
|
|
|
|
});
|