mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Register images for Lazy loading after changing Card Format
This commit is contained in:
1 parent
3984cea050
commit
41144d1323
1 file changed
+10
@@ -979,6 +979,16 @@
|
||||
entry.element = newContent;
|
||||
registerRuntime(entry);
|
||||
applyPresentationToElement(entry);
|
||||
// Fresh cards from format/mode rerender need explicit lazy observe (push path, no MO).
|
||||
if (window.cardBuilder?.registerLazyImagesInSection) {
|
||||
window.cardBuilder.registerLazyImagesInSection(newContent);
|
||||
} else if (window.cardBuilder?.registerLazyImagesIn) {
|
||||
window.cardBuilder.registerLazyImagesIn(newContent);
|
||||
}
|
||||
// Spotlight (and any section without .itemsContainer) still needs a root pass.
|
||||
if (isSpotlight && window.cardBuilder?.registerLazyImagesIn) {
|
||||
window.cardBuilder.registerLazyImagesIn(newContent);
|
||||
}
|
||||
|
||||
if (!isSpotlight && window.cardBuilder?.applyItemsLayoutState) {
|
||||
window.cardBuilder.invalidateLastRowPadding?.(newContent.querySelector('.itemsContainer'));
|
||||
|
||||
Reference in new issue
Block a user