*** CORE - Fixing theme4.js ***

This commit is contained in:
Aivars Zukovskis 2026-09-28 12:26:42 +03:00
parent 55975cf663
commit 0649a9e1b0
1 changed files with 22 additions and 8 deletions

View File

@ -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);
}