Spaces:
Running on Zero
Running on Zero
Download assets/layout.js from fffiloni/ZONOS3-Mini: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/fffiloni/ZONOS3-Mini/resolve/main/assets/layout.js
- Command line
-
hf download hf://spaces/fffiloni/ZONOS3-Mini/assets/layout.js
-
curl -L -o layout.js https://huggingface.co/spaces/fffiloni/ZONOS3-Mini/resolve/main/assets/layout.js
738 Bytes
| () => { | |
| const host = document.getElementById("script-input"); | |
| const field = host?.querySelector("textarea"); | |
| if (!field) return; | |
| // Gradio measures text before the final responsive width can settle. | |
| // Ask the native input handler to measure again when that width changes. | |
| let width = 0; | |
| const observer = new ResizeObserver(entries => { | |
| const next = entries[0].contentRect.width; | |
| if (Math.abs(next - width) < .5) return; | |
| width = next; | |
| requestAnimationFrame(() => { | |
| if (field.isConnected) field.dispatchEvent(new Event("input", {bubbles:true})); | |
| else observer.disconnect(); | |
| }); | |
| }); | |
| observer.observe(host); | |
| window.addEventListener("pagehide", () => observer.disconnect(), {once:true}); | |
| } | |