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:
space-nuko
2023-05-17 21:31:37 -05:00
parent 0cecbee21c
commit 967989494c
15 changed files with 51 additions and 42 deletions

View File

@@ -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;

View File

@@ -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) => {