Skip to content

Commit

Permalink
Merge pull request #1439 from scireum/feature/sbi/OX-11077
Browse files Browse the repository at this point in the history
Overlay - Prevent closing when click is dragged from within overlay to background
  • Loading branch information
sabieber authored Jun 27, 2024
2 parents acc7a08 + 29897fa commit 34d6255
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
let _overlay = null;
let shouldEscClose = null;
let LEFT_MOUSE_BUTTON_CODE = 0;

/**@
* Creates a new (hidden) overlay. This can be made visible to the user afterwards by calling `overlay.showOverlay`.
Expand Down Expand Up @@ -79,8 +80,8 @@
}

if (yieldable) {
_overlay.addEventListener('click', function (event) {
if (event.target === _overlay) {
_overlay.addEventListener('mousedown', function (event) {
if (event.button === LEFT_MOUSE_BUTTON_CODE && event.target === _overlay) {
sirius.dispatchEvent('sci-overlay-dismissed');
overlay.destroyOverlay();
}
Expand Down

0 comments on commit 34d6255

Please sign in to comment.