mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
fix button state warning
This commit is contained in:
@@ -26,13 +26,13 @@
|
|||||||
click_function?: (e: MouseEvent) => void;
|
click_function?: (e: MouseEvent) => void;
|
||||||
menu_options?: MenuOption[] | null;
|
menu_options?: MenuOption[] | null;
|
||||||
menu_class?: string;
|
menu_class?: string;
|
||||||
div_class?: string,
|
div_class?: string;
|
||||||
children?: any;
|
children?: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let menu_shown = $state(false);
|
let menu_shown = $state(false);
|
||||||
let button_element: HTMLButtonElement;
|
let button_element: HTMLButtonElement;
|
||||||
let menu_element: HTMLDivElement;
|
let menu_element: HTMLDivElement | null = $state(null);
|
||||||
let position_bottom = $state(true);
|
let position_bottom = $state(true);
|
||||||
|
|
||||||
function onclick(e: MouseEvent) {
|
function onclick(e: MouseEvent) {
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPolygon(): [number, number][] | null {
|
function getPolygon(): [number, number][] | null {
|
||||||
if (!button_element || !button_element) return null;
|
if (!button_element || !menu_element) return null;
|
||||||
const b = button_element.getBoundingClientRect();
|
const b = button_element.getBoundingClientRect();
|
||||||
const m = menu_element.getBoundingClientRect();
|
const m = menu_element.getBoundingClientRect();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user