@scenography/overlay-presets 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1041,10 +1041,12 @@ function artworkInfo(options) {
|
|
|
1041
1041
|
hide();
|
|
1042
1042
|
if (id) camera.centerArtwork(id, { minDistance: options.minCloseDistance ?? 0 });
|
|
1043
1043
|
};
|
|
1044
|
+
const onReset = () => hide();
|
|
1044
1045
|
const onPrev = () => step(-1);
|
|
1045
1046
|
const onNext = () => step(1);
|
|
1046
1047
|
const offSelect = ctx.gallery.on("artwork:select", onSelect);
|
|
1047
1048
|
const offReleased = ctx.gallery.on("artwork:released", onReleased);
|
|
1049
|
+
const offReset = ctx.gallery.on("camera:reset", onReset);
|
|
1048
1050
|
close.addEventListener("click", onClose);
|
|
1049
1051
|
prevBtn.addEventListener("click", onPrev);
|
|
1050
1052
|
nextBtn.addEventListener("click", onNext);
|
|
@@ -1055,6 +1057,7 @@ function artworkInfo(options) {
|
|
|
1055
1057
|
destroy() {
|
|
1056
1058
|
offSelect();
|
|
1057
1059
|
offReleased();
|
|
1060
|
+
offReset();
|
|
1058
1061
|
close.removeEventListener("click", onClose);
|
|
1059
1062
|
prevBtn.removeEventListener("click", onPrev);
|
|
1060
1063
|
nextBtn.removeEventListener("click", onNext);
|