well-waterfall 0.1.19 → 0.1.21
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 +1 -1
- package/src/waterfall.ts +19 -1
package/package.json
CHANGED
package/src/waterfall.ts
CHANGED
|
@@ -17,7 +17,7 @@ $('[waterfall]').each(function (index) {
|
|
|
17
17
|
const name = parseAttr($this, 'waterfall', `Swiper ${index}`);
|
|
18
18
|
const debug = Boolean(parseAttr($this, 'debug-mode', false) || false);
|
|
19
19
|
|
|
20
|
-
console.log(`Initializing Waterfall: ${name}
|
|
20
|
+
console.log(`Initializing Waterfall: ${name} ${debug ? '[DEBUG MODE]' : ''}`);
|
|
21
21
|
|
|
22
22
|
const swiperConfig: any = {
|
|
23
23
|
a11y: {
|
|
@@ -466,3 +466,21 @@ $('[waterfall]').each(function (index) {
|
|
|
466
466
|
|
|
467
467
|
sliders.push({ name, slider: swiper });
|
|
468
468
|
});
|
|
469
|
+
|
|
470
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
471
|
+
// --- SLIDE COUNT ----------------------------
|
|
472
|
+
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
|
473
|
+
|
|
474
|
+
// THIS NEEDS TO RUN AFTER THE SLIDERS HAVE BEEN INITIALIZED?
|
|
475
|
+
|
|
476
|
+
document.querySelectorAll('.swiper-wrapper').forEach((swiperWrapper) => {
|
|
477
|
+
console.log('SWIPER WRAPPER');
|
|
478
|
+
swiperWrapper.querySelectorAll('.swiper-slide').forEach((slide, index) => {
|
|
479
|
+
console.log('SWIPER SLIDE');
|
|
480
|
+
const countEl = slide.querySelector('[waterfall-el="slide-count"]');
|
|
481
|
+
if (countEl) {
|
|
482
|
+
console.log('SWIPER COUNT');
|
|
483
|
+
countEl.textContent = (index + 1).toString();
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
});
|