Add supoprt for modal dimmer element (#971)

This commit is contained in:
toasted-nutbread 2020-10-30 22:20:50 -04:00 committed by GitHub
parent 327d7b1f26
commit f5d6573bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,9 +117,11 @@ class Modal extends PopupElement {
prepare() { prepare() {
const node = this._node; const node = this._node;
node.addEventListener('mousedown', this._onModalContainerMouseDown.bind(this), false); let dimmerNode = node.querySelector('.modal-content-dimmer');
node.addEventListener('mouseup', this._onModalContainerMouseUp.bind(this), false); if (dimmerNode === null) { dimmerNode = node; }
node.addEventListener('click', this._onModalContainerClick.bind(this), false); dimmerNode.addEventListener('mousedown', this._onModalContainerMouseDown.bind(this), false);
dimmerNode.addEventListener('mouseup', this._onModalContainerMouseUp.bind(this), false);
dimmerNode.addEventListener('click', this._onModalContainerClick.bind(this), false);
} }
// Private // Private