From a310578b163c6a4fd87c244ef517f6699733eaf8 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Fri, 1 Mar 2024 19:38:37 -0800 Subject: [PATCH] Add secondary touch support to main quick menu button https://github.com/arianne/stendhal/issues/417 --- srcjs/stendhal/ui/quickmenu/QuickMenu.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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();