- CSS for modal dialog
- User can click outside modal dialog to close it
This commit is contained in:
parent
3bc17cea79
commit
8be2aa0129
9 changed files with 93 additions and 52 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use gloo::{events::EventListener, utils::document};
|
||||
use gloo::{console::log, events::EventListener, utils::document};
|
||||
use wasm_bindgen_futures::spawn_local;
|
||||
|
||||
use crate::{
|
||||
|
|
@ -61,7 +61,11 @@ pub fn setup_page() {
|
|||
|
||||
EventListener::new(&by_id("test-modal-dialog"), "click", move |_event| {
|
||||
spawn_local(async move {
|
||||
modal_dialog::show("#hidden-templates .modal-test-message").await;
|
||||
if modal_dialog::show("#hidden-templates .modal-test-message").await {
|
||||
log!("Ok");
|
||||
} else {
|
||||
log!("Cancel");
|
||||
}
|
||||
});
|
||||
})
|
||||
.forget();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue