chore(dialog): allow for not having an invokerNode
This commit is contained in:
parent
0b3149469a
commit
d1a410346d
1 changed files with 7 additions and 2 deletions
|
|
@ -21,11 +21,16 @@ export class LionDialog extends OverlayMixin(LitElement) {
|
|||
this.__toggle = () => {
|
||||
this.opened = !this.opened;
|
||||
};
|
||||
this._overlayCtrl.invokerNode.addEventListener('click', this.__toggle);
|
||||
|
||||
if (this._overlayCtrl.invokerNode) {
|
||||
this._overlayCtrl.invokerNode.addEventListener('click', this.__toggle);
|
||||
}
|
||||
}
|
||||
|
||||
_teardownOpenCloseListeners() {
|
||||
this._overlayCtrl.invokerNode.removeEventListener('click', this.__toggle);
|
||||
if (this._overlayCtrl.invokerNode) {
|
||||
this._overlayCtrl.invokerNode.removeEventListener('click', this.__toggle);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue