Use a element instead of nav to capture touchend event

This commit is contained in:
Kitaiti Makoto 2021-02-12 18:26:05 +09:00
parent 2c3d429b8e
commit f2411f4607

View File

@ -96,7 +96,7 @@ pub fn main() -> Result<(), JsValue> {
/// But :focus-within is not yet supported by Webkit/Blink /// But :focus-within is not yet supported by Webkit/Blink
fn menu() { fn menu() {
let document = window().unwrap().document().unwrap(); let document = window().unwrap().document().unwrap();
if let Some(button) = document.get_element_by_id("menu") { if let Ok(Some(button)) = document.query_selector("#menu a") {
if let Some(menu) = document.get_element_by_id("content") { if let Some(menu) = document.get_element_by_id("content") {
let show_menu = Closure::wrap(Box::new(|_: TouchEvent| { let show_menu = Closure::wrap(Box::new(|_: TouchEvent| {
window() window()