From 0649a9e1b04dd2489cfd24a92d391af98b091936 Mon Sep 17 00:00:00 2001 From: Aivars Zukovskis Date: Mon, 28 Sep 2026 12:26:42 +0300 Subject: [PATCH] *** CORE - Fixing theme4.js *** --- www/js/assets/theme4.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/www/js/assets/theme4.js b/www/js/assets/theme4.js index 9d1b9fb..7304f69 100644 --- a/www/js/assets/theme4.js +++ b/www/js/assets/theme4.js @@ -2341,7 +2341,11 @@ if($at_animated_wrap.length) { $at_animated_id = $at_animated_wrap.data("animated-id"); } - $at.aQueue["animate__animated_" + $at_animated_id].push($at_el); + var $at_queue_key = "animate__animated_" + $at_animated_id; + if(!Object.prototype.hasOwnProperty.call($at.aQueue, $at_queue_key) || !Array.isArray($at.aQueue[$at_queue_key])) { + $at.aQueue[$at_queue_key] = []; + } + $at.aQueue[$at_queue_key].push($at_el); $at.processItemQueue(); } else { $this.addClass($this.data("animate")).addClass("animate__animated"); @@ -2358,21 +2362,31 @@ } $at.aTimer = window.setInterval(function() { var $at_queue = false; + var $at_queue_id = null; + for(var $at_animated_id in $at.aQueue) { - if($at.aQueue[$at_animated_id].length) { + if(!Object.prototype.hasOwnProperty.call($at.aQueue, $at_animated_id)) { + continue; + } + var currentQueue = $at.aQueue[$at_animated_id]; + if(Array.isArray(currentQueue) && currentQueue.length) { $at_queue = true; + $at_queue_id = $at_animated_id; break; } } - if($at_queue) { - for(var $at_animated_id in $at.aQueue) { - var $at_item = $($at.aQueue[$at_animated_id].shift()); - $at_item.addClass($at_item.data("animate")).addClass("animate__animated"); + + if($at_queue && $at_queue_id !== null) { + var currentQueue = $at.aQueue[$at_queue_id]; + if(Array.isArray(currentQueue) && currentQueue.length) { + var $at_item = $(currentQueue.shift()); + if($at_item.length) { + $at_item.addClass($at_item.data("animate")).addClass("animate__animated"); + } } - $at.processItemQueue(); } else { window.clearInterval($at.aTimer); - $at.aTimer = null + $at.aTimer = null; } }, $at.aDelay); }