mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-29 06:51:01 +00:00
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
This commit is contained in:
parent
df6f398efc
commit
c66ef5f85d
1 changed files with 3 additions and 3 deletions
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue