From 4f8bc303471f732eb8082a97fb5576914fac18e4 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 15 Sep 2025 14:25:44 +0800 Subject: refactor: shadow is no longer a child of overlay --- src/lightbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lightbox.js') diff --git a/src/lightbox.js b/src/lightbox.js index 1a93a53..36eccb8 100644 --- a/src/lightbox.js +++ b/src/lightbox.js @@ -66,9 +66,8 @@ export default class LightBox { this.shadows[image.id] = shadow; } + if (!document.body.contains(shadow.element)) shadow.placeItself(); shadow.open(); - - this.overlay.add(shadow); this.overlay.show(); } @@ -79,6 +78,7 @@ export default class LightBox { shadow.close(); this.overlay.hide(); + shadow.destroyItself(); } closeAll() { -- cgit v1.2.3