diff --git a/srcjs/stendhal/ui/quickmenu/QuickMenu.ts b/srcjs/stendhal/ui/quickmenu/QuickMenu.ts index 051d8ce7601..9ae0c642c1d 100644 --- a/srcjs/stendhal/ui/quickmenu/QuickMenu.ts +++ b/srcjs/stendhal/ui/quickmenu/QuickMenu.ts @@ -24,6 +24,8 @@ import { ui } from "../UI"; import { Paths } from "../../data/Paths"; +import { ElementClickHandler } from "../../util/ElementClickHandler"; + /** * Main button to show/hide quick menu buttons. @@ -87,9 +89,9 @@ export class QuickMenu { } btn_main.src = Paths.gui + "/quickmenu/main.png"; - btn_main.addEventListener("click", function(e) { + new ElementClickHandler(btn_main).onClick = function(evt: Event) { QuickMenu.toggle(); - }); + }; // hide buttons by default QuickMenu.update();