Skip to content

Commit 674acd5

Browse files
Update aloader.js
1 parent 86e39a8 commit 674acd5

1 file changed

Lines changed: 27 additions & 33 deletions

File tree

‎aloader.js‎

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@
176176
if (aniActive === 'true') {
177177
elements[i].classList.remove('hide');
178178
console.log('select_ani_mation shown (hide class removed)');
179+
// Оновлюємо прев’ю, якщо є ani_load
180+
if (Lampa.Storage.get('ani_load')) {
181+
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
182+
console.log('insert_activity_loader_prv called in updateAniVisibility');
183+
}
179184
} else {
180185
elements[i].classList.add('hide');
181186
console.log('select_ani_mation hidden (hide class added)');
@@ -191,6 +196,11 @@
191196
if (aniActive === 'true') {
192197
retryElements[j].classList.remove('hide');
193198
console.log('select_ani_mation retry shown (hide class removed)');
199+
// Оновлюємо прев’ю, якщо є ani_load
200+
if (Lampa.Storage.get('ani_load')) {
201+
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
202+
console.log('insert_activity_loader_prv called in retry');
203+
}
194204
} else {
195205
retryElements[j].classList.add('hide');
196206
console.log('select_ani_mation retry hidden (hide class added)');
@@ -199,7 +209,7 @@
199209
} else {
200210
console.log('select_ani_mation still not found after retry');
201211
}
202-
}, 1000);
212+
}, 2000);
203213
}
204214
// Оновлюємо меню налаштувань
205215
if (Lampa.Settings && Lampa.Settings.render) {
@@ -218,6 +228,11 @@
218228
for (var i = 0; i < elements.length; i++) {
219229
elements[i].classList.remove('hide');
220230
console.log('forceShowAniSelect: select_ani_mation shown (hide class removed)');
231+
// Оновлюємо прев’ю, якщо є ani_load
232+
if (Lampa.Storage.get('ani_load')) {
233+
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
234+
console.log('insert_activity_loader_prv called in forceShowAniSelect');
235+
}
221236
}
222237
} else {
223238
console.log('forceShowAniSelect: select_ani_mation not found');
@@ -233,11 +248,16 @@
233248
for (var j = 0; j < retryElements.length; j++) {
234249
retryElements[j].classList.remove('hide');
235250
console.log('forceShowAniSelect retry: select_ani_mation shown (hide class removed)');
251+
// Оновлюємо прев’ю, якщо є ani_load
252+
if (Lampa.Storage.get('ani_load')) {
253+
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
254+
console.log('insert_activity_loader_prv called in forceShowAniSelect retry');
255+
}
236256
}
237257
} else {
238258
console.log('forceShowAniSelect retry: select_ani_mation not found');
239259
}
240-
}, 1000);
260+
}, 2000);
241261
};
242262

243263
// Експортуємо функцію для дебагу
@@ -286,13 +306,7 @@
286306
// Оновлюємо видимість параметра
287307
setTimeout(function() {
288308
updateAniVisibility();
289-
}, 500);
290-
},
291-
onRender: function (item) {
292-
if (item) {
293-
item.classList.remove('hide');
294-
console.log('ani_active onRender, hide class removed');
295-
}
309+
}, 1000);
296310
}
297311
});
298312
console.log('Parameter ani_active added');
@@ -316,23 +330,6 @@
316330
name: '<div class="settings-folder__icon" style="display: inline-block; vertical-align: middle; width: 23px; height: 24px; margin-right: 10px;"><div class="activity__loader_prv"></div></div>' + Lampa.Lang.translate('params_ani_select'),
317331
description: Lampa.Lang.translate('params_ani_select')
318332
},
319-
onRender: function (item) {
320-
if (item) {
321-
var aniActive = Lampa.Storage.get('ani_active', 'false');
322-
if (aniActive === 'true') {
323-
item.classList.remove('hide');
324-
console.log('select_ani_mation onRender, hide class removed');
325-
} else {
326-
item.classList.add('hide');
327-
console.log('select_ani_mation onRender, hide class added');
328-
}
329-
setTimeout(function () {
330-
if (Lampa.Storage.get('ani_load')) {
331-
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
332-
}
333-
}, 0);
334-
}
335-
},
336333
onChange: function () {
337334
// Перевіряємо наявність списку SVG-завантажувачів
338335
if (!window.svg_loaders || window.svg_loaders.length === 0) {
@@ -421,7 +418,7 @@
421418
setTimeout(function() {
422419
updateAniVisibility();
423420
console.log('Initial updateAniVisibility called');
424-
}, 1000);
421+
}, 2000);
425422
}
426423

427424
// Слухаємо зміни параметра ani_active та color_plugin_main_color
@@ -430,10 +427,7 @@
430427
console.log('Storage change: ani_active =', Lampa.Storage.get('ani_active', 'false'));
431428
setTimeout(function() {
432429
updateAniVisibility();
433-
if (Lampa.Storage.get('ani_active', 'false') === 'true' && Lampa.Storage.get('ani_load')) {
434-
insert_activity_loader_prv(Lampa.Storage.get('ani_load'));
435-
}
436-
}, 500);
430+
}, 1000);
437431
}
438432
// Оновлюємо стилі при зміні кольору виділення
439433
if (e.name === 'color_plugin_main_color') {
@@ -453,7 +447,7 @@
453447
updateAniVisibility();
454448
setTimeout(function() {
455449
updateAniVisibility();
456-
}, 500);
450+
}, 1000);
457451
}
458452
});
459453

@@ -463,7 +457,7 @@
463457
console.log('App event:', e.type);
464458
setTimeout(function() {
465459
updateAniVisibility();
466-
}, 500);
460+
}, 1000);
467461
}
468462
});
469463

0 commit comments

Comments
 (0)