Skip to content

Commit

Permalink
Merge branch 'bugfix/KAD-4209_progress_bar_init_in_ql' of https://git…
Browse files Browse the repository at this point in the history
…hub.com/stellarwp/kadence-blocks into bugfix/KAD-4209_progress_bar_init_in_ql
  • Loading branch information
oakesjosh committed Feb 28, 2025
2 parents 20ca785 + 76d1b1c commit 6046015
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/assets/js/kb-progress-bars.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@
let barContainers;
if (onlyInQueryLoop) {
// Only select progress bars inside query cards when onlyInQueryLoop is true
barContainers = document.querySelectorAll('.wp-block-kadence-query-card .kb-progress-bar-container' + item.unique_id);
barContainers = document.querySelectorAll(
'.wp-block-kadence-query-card .kb-progress-bar-container' + item.unique_id
);
} else {
// Select all progress bars when onlyInQueryLoop is false
barContainers = document.querySelectorAll('.kb-progress-bar-container' + item.unique_id);
Expand Down Expand Up @@ -192,16 +194,15 @@
};
if ('loading' === document.readyState) {
// The DOM has not yet been loaded.
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function () {
kadenceProgressBars.init(false);
});
} else {
// The DOM has already been loaded.
kadenceProgressBars.init(false);
}
window.addEventListener('resize', kadenceProgressBars.windowResize, false);
document.addEventListener('kb-query-loaded', function() {
document.addEventListener('kb-query-loaded', function () {
kadenceProgressBars.init(true);
});

})();

0 comments on commit 6046015

Please sign in to comment.