Register images for Lazy loading after changing Card Format

This commit is contained in:
HighImKevin committed 2026-10-02 05:55:47 -04:00
1 parent 3984cea050
commit 41144d1323
1 file changed
+10
+10
View File
@@ -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'));