@frybynite/image-cloud 0.3.5 → 0.3.6
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/image-cloud-auto-init.js +413 -410
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +12 -9
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +2 -2
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/package.json +1 -1
package/dist/image-cloud.js
CHANGED
|
@@ -3011,25 +3011,28 @@ class _e {
|
|
|
3011
3011
|
*/
|
|
3012
3012
|
navigateToNextImage() {
|
|
3013
3013
|
if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
|
|
3014
|
-
const t = (this.currentFocusIndex + 1) % this.imageElements.
|
|
3015
|
-
|
|
3014
|
+
const t = (this.currentFocusIndex + 1) % this.imageLayouts.length, e = this.imageElements.find(
|
|
3015
|
+
(n) => n.dataset.imageId === String(t)
|
|
3016
|
+
);
|
|
3017
|
+
if (!e) return;
|
|
3018
|
+
const i = this.imageLayouts[t];
|
|
3019
|
+
i && (this.currentFocusIndex = t, this.handleImageClick(e, i), this.updateCounter(t));
|
|
3016
3020
|
}
|
|
3017
3021
|
/**
|
|
3018
3022
|
* Navigate to the previous image (Left arrow)
|
|
3019
3023
|
*/
|
|
3020
3024
|
navigateToPreviousImage() {
|
|
3021
3025
|
if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
|
|
3022
|
-
const t = (this.currentFocusIndex - 1 + this.
|
|
3023
|
-
|
|
3026
|
+
const t = (this.currentFocusIndex - 1 + this.imageLayouts.length) % this.imageLayouts.length, e = this.imageElements.find(
|
|
3027
|
+
(n) => n.dataset.imageId === String(t)
|
|
3028
|
+
);
|
|
3029
|
+
if (!e) return;
|
|
3030
|
+
const i = this.imageLayouts[t];
|
|
3031
|
+
i && (this.currentFocusIndex = t, this.handleImageClick(e, i), this.updateCounter(t));
|
|
3024
3032
|
}
|
|
3025
3033
|
/**
|
|
3026
3034
|
* Navigate to a specific image by index
|
|
3027
3035
|
*/
|
|
3028
|
-
async navigateToImage(t) {
|
|
3029
|
-
if (t < 0 || t >= this.imageElements.length) return;
|
|
3030
|
-
const e = this.imageElements[t], i = this.imageLayouts[t];
|
|
3031
|
-
!e || !i || await this.handleImageClick(e, i);
|
|
3032
|
-
}
|
|
3033
3036
|
handleResize() {
|
|
3034
3037
|
this.imagesLoaded && (this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.resizeTimeout = window.setTimeout(() => {
|
|
3035
3038
|
const t = this.getImageHeight();
|