well-waterfall 1.2.7 → 1.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-waterfall",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Create Swipers in Webflow with attributes",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.es.js",
package/src/index.ts CHANGED
@@ -49,15 +49,26 @@ function initAll(selector: string, startIndex: number): number {
49
49
 
50
50
  let indexCounter = 0;
51
51
 
52
- // Initialize all other sliders
53
- document.querySelectorAll(`[${ATTR_WATERFALL}]`).forEach((el) => {
54
- if (el.hasAttribute(ATTR_THUMBS) || el.hasAttribute(ATTR_CONTROLLER)) return;
55
- initConfig(el as HTMLElement, indexCounter++);
56
- });
52
+ document.addEventListener("DOMContentLoaded", () => {
53
+ // Initialize all other sliders
54
+ document.querySelectorAll(`[${ATTR_WATERFALL}]`).forEach((el) => {
55
+ if (el.hasAttribute(ATTR_THUMBS) || el.hasAttribute(ATTR_CONTROLLER)) return;
56
+ initConfig(el as HTMLElement, indexCounter++);
57
+ });
58
+
59
+ // Initialize Controller Sliders last
60
+ indexCounter = initAll(`[${ATTR_WATERFALL}][${ATTR_THUMBS}]`, indexCounter);
61
+ indexCounter = initAll(`[${ATTR_WATERFALL}][${ATTR_CONTROLLER}]`, indexCounter);
62
+
63
+ // MANIPULATION
64
+ manipulateSlides();
57
65
 
58
- // Initialize Controller Sliders last
59
- indexCounter = initAll(`[${ATTR_WATERFALL}][${ATTR_THUMBS}]`, indexCounter);
60
- indexCounter = initAll(`[${ATTR_WATERFALL}][${ATTR_CONTROLLER}]`, indexCounter);
66
+ // SLIDE COUNT
67
+ initSlideCount();
68
+
69
+ // ARIA ROLE FIX FOR WEBFLOW CMS LIST
70
+ fixWebflowCMSListARIARole();
71
+ });
61
72
 
62
73
  // Config
63
74
  function initConfig(el: HTMLElement, index: number) {
@@ -112,11 +123,3 @@ function initConfig(el: HTMLElement, index: number) {
112
123
  }
113
124
  }
114
125
 
115
- // MANIPULATION
116
- manipulateSlides();
117
-
118
- // SLIDE COUNT
119
- initSlideCount();
120
-
121
- // ARIA ROLE FIX FOR WEBFLOW CMS LIST
122
- fixWebflowCMSListARIARole();