From c66ef5f85d4efb096f3b294cbe78aa8dc1359c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C4=BDach?= Date: Sat, 16 Nov 2019 18:52:30 +0100 Subject: [PATCH] Fix the navigation menu not opening on touch (#690) * Fix iOS menu issue * Fix burger menu iOS trigger * Modify the menu script to work on iOS too * Update main.rs * Update main.rs * Update main.rs --- plume-front/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plume-front/src/main.rs b/plume-front/src/main.rs index 0107b139..ebb42c11 100644 --- a/plume-front/src/main.rs +++ b/plume-front/src/main.rs @@ -69,19 +69,19 @@ fn main() { .ok(); } -/// Toggle menu on mobile device +/// Toggle menu on mobile devices /// /// It should normally be working fine even without this code /// But :focus-within is not yet supported by Webkit/Blink fn menu() { if let Some(button) = document().get_element_by_id("menu") { if let Some(menu) = document().get_element_by_id("content") { - button.add_event_listener(|_: ClickEvent| { + button.add_event_listener(|_: TouchEnd| { document() .get_element_by_id("menu") .map(|menu| menu.class_list().add("show")); }); - menu.add_event_listener(|_: ClickEvent| { + menu.add_event_listener(|_: TouchEnd| { document() .get_element_by_id("menu") .map(|menu| menu.class_list().remove("show"));