mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
19 lines
474 B
JavaScript
19 lines
474 B
JavaScript
import ApplicationController from "./application_controller";
|
|
|
|
export default class extends ApplicationController {
|
|
connect() {
|
|
super.connect();
|
|
window.addEventListener("click", this.handleClick);
|
|
}
|
|
disconnect() {
|
|
super.disconnect();
|
|
window.removeEventListener("click", this.handleClick);
|
|
}
|
|
|
|
handleClick = (event) => {
|
|
if (!this.element.contains(event.target)) {
|
|
this.stimulate("SuperSelectorComponent#close", this.element);
|
|
}
|
|
};
|
|
}
|