Remove fixed-height of Gallery preview in Gradio
parent
03095102da
commit
3c312bde08
|
|
@ -235,8 +235,19 @@ onUiLoaded(async () => {
|
|||
function setStyleHeight(elemId, height) {
|
||||
const elem = gradioApp().querySelector(elemId);
|
||||
if (elem) {
|
||||
if (elem.style.height === null || elem.style.height === "") {
|
||||
if (!elem.style.height) {
|
||||
elem.style.height = height;
|
||||
const observer = new MutationObserver(() => {
|
||||
const divPreview = elem.querySelector(".preview");
|
||||
if (divPreview) {
|
||||
divPreview.classList.remove("fixed-height");
|
||||
}
|
||||
});
|
||||
observer.observe(elem, {
|
||||
childList: true,
|
||||
attributes: true,
|
||||
attributeFilter: ["class"],
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue