check the mime type of the collections file field and updated field styles to minimize the layout shifts

This commit is contained in:
Gani Georgiev
2023-10-15 06:49:32 +03:00
parent 007b6a04ff
commit c0fa53a2ab
34 changed files with 111 additions and 99 deletions
+22 -22
View File
@@ -167,34 +167,34 @@
contentScrollClass = "";
}
if (!panel) {
if (!panel || contentScrollThrottle) {
return;
}
if (!contentScrollThrottle) {
contentScrollThrottle = setTimeout(() => {
clearTimeout(contentScrollThrottle);
contentScrollThrottle = null;
contentScrollThrottle = setTimeout(() => {
clearTimeout(contentScrollThrottle);
contentScrollThrottle = null;
if (!panel) {
return; // deleted during timeout
}
console.log("here");
let heightDiff = panel.scrollHeight - panel.offsetHeight;
if (heightDiff > 0) {
contentScrollClass = "scrollable";
} else {
contentScrollClass = "";
return; // no scroll
}
if (!panel) {
return; // deleted during timeout
}
if (panel.scrollTop == 0) {
contentScrollClass += " scroll-top-reached";
} else if (panel.scrollTop + panel.offsetHeight == panel.scrollHeight) {
contentScrollClass += " scroll-bottom-reached";
}
}, 100);
}
let heightDiff = panel.scrollHeight - panel.offsetHeight;
if (heightDiff > 0) {
contentScrollClass = "scrollable";
} else {
contentScrollClass = "";
return; // no scroll
}
if (panel.scrollTop == 0) {
contentScrollClass += " scroll-top-reached";
} else if (panel.scrollTop + panel.offsetHeight == panel.scrollHeight) {
contentScrollClass += " scroll-bottom-reached";
}
}, 100);
}
onMount(() => {