mirror of
https://github.com/tabler/tabler.git
synced 2026-06-17 12:50:03 +04:00
Enable scrollSpy in countup module (#2113)
Co-authored-by: Paweł Kuna <1282324+codecalm@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tabler/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Enable `scrollSpy` in `countup` module
|
||||||
@@ -4,7 +4,9 @@ if (elements.length) {
|
|||||||
elements.forEach(function (element) {
|
elements.forEach(function (element) {
|
||||||
let options = {};
|
let options = {};
|
||||||
try {
|
try {
|
||||||
options = element.getAttribute('data-countup') ? JSON.parse(element.getAttribute('data-countup')) : {};
|
const dataOptions = element.getAttribute('data-countup') ? JSON.parse(element.getAttribute('data-countup')) : {};
|
||||||
|
options = Object.assign({'enableScrollSpy': true}, dataOptions);
|
||||||
|
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
|
|
||||||
const value = parseInt(element.innerHTML, 10);
|
const value = parseInt(element.innerHTML, 10);
|
||||||
@@ -14,4 +16,4 @@ if (elements.length) {
|
|||||||
countUp.start();
|
countUp.start();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user