mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Enable event propagation (#3062)
This commit is contained in:
@@ -35,14 +35,15 @@ pub struct PageTransitionEventHandle {
|
||||
}
|
||||
|
||||
pub fn on_page_transition(
|
||||
window: &web_sys::Window,
|
||||
window: web_sys::Window,
|
||||
show_handler: impl FnMut(PageTransitionEvent) + 'static,
|
||||
hide_handler: impl FnMut(PageTransitionEvent) + 'static,
|
||||
) -> PageTransitionEventHandle {
|
||||
let show_closure = Closure::new(show_handler);
|
||||
let hide_closure = Closure::new(hide_handler);
|
||||
|
||||
let show_listener = event_handle::EventListenerHandle::new(window, "pageshow", show_closure);
|
||||
let show_listener =
|
||||
event_handle::EventListenerHandle::new(window.clone(), "pageshow", show_closure);
|
||||
let hide_listener = event_handle::EventListenerHandle::new(window, "pagehide", hide_closure);
|
||||
PageTransitionEventHandle {
|
||||
_show_listener: show_listener,
|
||||
|
||||
Reference in New Issue
Block a user