|
176 | 176 | if (aniActive === 'true') { |
177 | 177 | elements[i].classList.remove('hide'); |
178 | 178 | 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 | + } |
179 | 184 | } else { |
180 | 185 | elements[i].classList.add('hide'); |
181 | 186 | console.log('select_ani_mation hidden (hide class added)'); |
|
191 | 196 | if (aniActive === 'true') { |
192 | 197 | retryElements[j].classList.remove('hide'); |
193 | 198 | 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 | + } |
194 | 204 | } else { |
195 | 205 | retryElements[j].classList.add('hide'); |
196 | 206 | console.log('select_ani_mation retry hidden (hide class added)'); |
|
199 | 209 | } else { |
200 | 210 | console.log('select_ani_mation still not found after retry'); |
201 | 211 | } |
202 | | - }, 1000); |
| 212 | + }, 2000); |
203 | 213 | } |
204 | 214 | // Оновлюємо меню налаштувань |
205 | 215 | if (Lampa.Settings && Lampa.Settings.render) { |
|
218 | 228 | for (var i = 0; i < elements.length; i++) { |
219 | 229 | elements[i].classList.remove('hide'); |
220 | 230 | 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 | + } |
221 | 236 | } |
222 | 237 | } else { |
223 | 238 | console.log('forceShowAniSelect: select_ani_mation not found'); |
|
233 | 248 | for (var j = 0; j < retryElements.length; j++) { |
234 | 249 | retryElements[j].classList.remove('hide'); |
235 | 250 | 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 | + } |
236 | 256 | } |
237 | 257 | } else { |
238 | 258 | console.log('forceShowAniSelect retry: select_ani_mation not found'); |
239 | 259 | } |
240 | | - }, 1000); |
| 260 | + }, 2000); |
241 | 261 | }; |
242 | 262 |
|
243 | 263 | // Експортуємо функцію для дебагу |
|
286 | 306 | // Оновлюємо видимість параметра |
287 | 307 | setTimeout(function() { |
288 | 308 | 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); |
296 | 310 | } |
297 | 311 | }); |
298 | 312 | console.log('Parameter ani_active added'); |
|
316 | 330 | 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'), |
317 | 331 | description: Lampa.Lang.translate('params_ani_select') |
318 | 332 | }, |
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 | | - }, |
336 | 333 | onChange: function () { |
337 | 334 | // Перевіряємо наявність списку SVG-завантажувачів |
338 | 335 | if (!window.svg_loaders || window.svg_loaders.length === 0) { |
|
421 | 418 | setTimeout(function() { |
422 | 419 | updateAniVisibility(); |
423 | 420 | console.log('Initial updateAniVisibility called'); |
424 | | - }, 1000); |
| 421 | + }, 2000); |
425 | 422 | } |
426 | 423 |
|
427 | 424 | // Слухаємо зміни параметра ani_active та color_plugin_main_color |
|
430 | 427 | console.log('Storage change: ani_active =', Lampa.Storage.get('ani_active', 'false')); |
431 | 428 | setTimeout(function() { |
432 | 429 | 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); |
437 | 431 | } |
438 | 432 | // Оновлюємо стилі при зміні кольору виділення |
439 | 433 | if (e.name === 'color_plugin_main_color') { |
|
453 | 447 | updateAniVisibility(); |
454 | 448 | setTimeout(function() { |
455 | 449 | updateAniVisibility(); |
456 | | - }, 500); |
| 450 | + }, 1000); |
457 | 451 | } |
458 | 452 | }); |
459 | 453 |
|
|
463 | 457 | console.log('App event:', e.type); |
464 | 458 | setTimeout(function() { |
465 | 459 | updateAniVisibility(); |
466 | | - }, 500); |
| 460 | + }, 1000); |
467 | 461 | } |
468 | 462 | }); |
469 | 463 |
|
|
0 commit comments