summaryrefslogtreecommitdiff
path: root/src/lightbox.js
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-15 14:25:44 +0800
committerEltrac <hi@guhub.cn>2025-09-15 14:25:44 +0800
commit4f8bc303471f732eb8082a97fb5576914fac18e4 (patch)
treefd0b427b3f9f77942bca23f6a9ffcaaa657e7921 /src/lightbox.js
parentb0c616f123830c0623765e91dd3a71de8328b647 (diff)
refactor: shadow is no longer a child of overlay
Diffstat (limited to 'src/lightbox.js')
-rw-r--r--src/lightbox.js4
1 files changed, 2 insertions, 2 deletions
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() {