Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -516,13 +516,13 @@ with gr.Blocks(css=css, theme=gr.themes.Default(font=[gr.themes.GoogleFont("Play
|
|
| 516 |
"""
|
| 517 |
<script>
|
| 518 |
window.addEventListener('load', () => {
|
| 519 |
-
const observer = new MutationObserver(() => {
|
| 520 |
-
const svg = document.querySelector('svg.svelte-zyxd38');
|
| 521 |
-
if (!svg) return;
|
| 522 |
// 一度挿入したら再挿入しない
|
| 523 |
-
if (svg.querySelector('foreignObject#custom-loader-fo')) return;
|
| 524 |
-
|
| 525 |
-
if (component25) {
|
| 526 |
// カスタムローダーのHTML
|
| 527 |
const loaderHTML = `
|
| 528 |
<div id="custom-loader">
|
|
@@ -542,11 +542,11 @@ window.addEventListener('load', () => {
|
|
| 542 |
</div>
|
| 543 |
</div>
|
| 544 |
`;
|
| 545 |
-
component25.insertAdjacentHTML('
|
| 546 |
}
|
| 547 |
-
|
| 548 |
});
|
| 549 |
-
observer.observe(document.body, { childList: true, subtree: true });
|
| 550 |
});
|
| 551 |
</script>
|
| 552 |
"""
|
|
|
|
| 516 |
"""
|
| 517 |
<script>
|
| 518 |
window.addEventListener('load', () => {
|
| 519 |
+
// const observer = new MutationObserver(() => {
|
| 520 |
+
// const svg = document.querySelector('svg.svelte-zyxd38');
|
| 521 |
+
// if (!svg) return;
|
| 522 |
// 一度挿入したら再挿入しない
|
| 523 |
+
// if (svg.querySelector('foreignObject#custom-loader-fo')) return;
|
| 524 |
+
const component25 = document.getElementById('component-25');
|
| 525 |
+
if (component25) {
|
| 526 |
// カスタムローダーのHTML
|
| 527 |
const loaderHTML = `
|
| 528 |
<div id="custom-loader">
|
|
|
|
| 542 |
</div>
|
| 543 |
</div>
|
| 544 |
`;
|
| 545 |
+
component25.insertAdjacentHTML('afterbegin', loaderHTML);
|
| 546 |
}
|
| 547 |
+
|
| 548 |
});
|
| 549 |
+
// observer.observe(document.body, { childList: true, subtree: true });
|
| 550 |
});
|
| 551 |
</script>
|
| 552 |
"""
|