Fix stats counter resetting
This commit is contained in:
parent
5702bd3afd
commit
e0577e90e0
1 changed files with 6 additions and 0 deletions
|
@ -21,6 +21,8 @@ $(function() {
|
||||||
entries.forEach(entry => {
|
entries.forEach(entry => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
showStatistic($('#wishes .value'), response.data.wishes.count, 0);
|
showStatistic($('#wishes .value'), response.data.wishes.count, 0);
|
||||||
|
|
||||||
|
observerWishes.unobserve(document.querySelector('#wishes'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -28,6 +30,8 @@ $(function() {
|
||||||
entries.forEach(entry => {
|
entries.forEach(entry => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
showStatistic($('#wishlists .value'), response.data.wishlists.count, 0);
|
showStatistic($('#wishlists .value'), response.data.wishlists.count, 0);
|
||||||
|
|
||||||
|
observerWishlists.unobserve(document.querySelector('#wishlists'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -35,6 +39,8 @@ $(function() {
|
||||||
entries.forEach(entry => {
|
entries.forEach(entry => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
showStatistic($('#users .value'), response.data.users.count, 0);
|
showStatistic($('#users .value'), response.data.users.count, 0);
|
||||||
|
|
||||||
|
observerUsers.unobserve(document.querySelector('#users'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue