Make links in menu work on iOS

This commit is contained in:
Kitaiti Makoto 2021-02-13 23:40:18 +09:00
parent 94ccbd6190
commit ed22c6b103

View File

@ -114,7 +114,18 @@ fn menu() {
.unwrap();
show_menu.forget();
let close_menu = Closure::wrap(Box::new(|_: TouchEvent| {
let close_menu = Closure::wrap(Box::new(|evt: TouchEvent| {
if evt
.target()
.unwrap()
.dyn_ref::<Element>()
.unwrap()
.closest("a")
.unwrap()
.is_some()
{
return;
}
self::document()
.get_element_by_id("menu")
.map(|menu| {