window object does weird things, rename root ID
when used with (window as any).app, it uses the element with id #app instead
This commit is contained in:
@@ -172,8 +172,6 @@
|
||||
|
||||
onMount(async () => {
|
||||
await app.setup();
|
||||
(window as any).app = app;
|
||||
(window as any).appPane = uiPane;
|
||||
|
||||
// await import('../../scss/ux.scss');
|
||||
|
||||
@@ -185,10 +183,10 @@
|
||||
}
|
||||
|
||||
$: if (uiTheme === "gradio-dark") {
|
||||
document.getElementById("app").classList.add("dark")
|
||||
document.getElementById("app-root").classList.add("dark")
|
||||
}
|
||||
else {
|
||||
document.getElementById("app").classList.remove("dark")
|
||||
document.getElementById("app-root").classList.remove("dark")
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ export default class ComfyApp {
|
||||
|
||||
this.setupColorScheme()
|
||||
|
||||
this.rootEl = document.getElementById("app") as HTMLDivElement;
|
||||
this.rootEl = document.getElementById("app-root") as HTMLDivElement;
|
||||
this.canvasEl = document.getElementById("graph-canvas") as HTMLCanvasElement;
|
||||
this.lGraph = new ComfyGraph();
|
||||
this.lCanvas = new ComfyGraphCanvas(this, this.canvasEl);
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
object_fit: "cover",
|
||||
height: "auto"
|
||||
};
|
||||
export let imageWidth: number = 1;
|
||||
export let imageHeight: number = 1;
|
||||
export let imageWidth: number = 0;
|
||||
export let imageHeight: number = 0;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
select: SelectData;
|
||||
@@ -32,8 +32,8 @@
|
||||
let was_reset: boolean = true;
|
||||
|
||||
$: if (selected_image == null || was_reset) {
|
||||
imageWidth = 1;
|
||||
imageHeight = 1;
|
||||
imageWidth = 0;
|
||||
imageHeight = 0;
|
||||
}
|
||||
|
||||
$: was_reset = value == null || value.length == 0 ? true : was_reset;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
export let label: string | undefined = undefined;
|
||||
export let show_label: boolean;
|
||||
export let selectable: boolean = false;
|
||||
export let imageWidth: number = 1;
|
||||
export let imageHeight: number = 1;
|
||||
export let imageWidth: number = 0;
|
||||
export let imageHeight: number = 0;
|
||||
let imageElem: HTMLImageElement | null = null;
|
||||
|
||||
const dispatch = createEventDispatcher<{
|
||||
@@ -23,8 +23,8 @@
|
||||
$: value && dispatch("change", value);
|
||||
|
||||
$: if (value == null || !imageElem) {
|
||||
imageWidth = 1;
|
||||
imageHeight = 1;
|
||||
imageWidth = 0;
|
||||
imageHeight = 0;
|
||||
}
|
||||
|
||||
const handle_click = (evt: MouseEvent) => {
|
||||
|
||||
Reference in New Issue
Block a user