From f5d6573bec6ee0133e260d1a7825d91ba5d6c9e7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 30 Oct 2020 22:20:50 -0400 Subject: [PATCH] Add supoprt for modal dimmer element (#971) --- ext/bg/js/settings/popup-elements.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/bg/js/settings/popup-elements.js b/ext/bg/js/settings/popup-elements.js index 4b4a0e17..decb39e1 100644 --- a/ext/bg/js/settings/popup-elements.js +++ b/ext/bg/js/settings/popup-elements.js @@ -117,9 +117,11 @@ class Modal extends PopupElement { prepare() { const node = this._node; - node.addEventListener('mousedown', this._onModalContainerMouseDown.bind(this), false); - node.addEventListener('mouseup', this._onModalContainerMouseUp.bind(this), false); - node.addEventListener('click', this._onModalContainerClick.bind(this), false); + let dimmerNode = node.querySelector('.modal-content-dimmer'); + if (dimmerNode === null) { dimmerNode = node; } + 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