|
|
@ -1,4 +1,4 @@
|
|
|
|
use std::rc::Rc;
|
|
|
|
use crate::locales::trl;
|
|
|
|
use leptos::*;
|
|
|
|
use leptos::*;
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
@ -21,11 +21,11 @@ impl DialogOpener {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn show(&self) {
|
|
|
|
pub fn show(&self) {
|
|
|
|
self.set_visible.update(|state| { *state = true});
|
|
|
|
self.set_visible.update(|state| *state = true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn hide(&self) {
|
|
|
|
pub fn hide(&self) {
|
|
|
|
self.set_visible.update(|state| { *state = false});
|
|
|
|
self.set_visible.update(|state| *state = false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -33,10 +33,9 @@ impl DialogOpener {
|
|
|
|
pub fn ModalDialog(
|
|
|
|
pub fn ModalDialog(
|
|
|
|
cx: Scope,
|
|
|
|
cx: Scope,
|
|
|
|
opener: DialogOpener,
|
|
|
|
opener: DialogOpener,
|
|
|
|
title: String,
|
|
|
|
title: &'static str,
|
|
|
|
children: Children,
|
|
|
|
children: Children,
|
|
|
|
) -> impl IntoView {
|
|
|
|
) -> impl IntoView {
|
|
|
|
|
|
|
|
|
|
|
|
view! {cx,
|
|
|
|
view! {cx,
|
|
|
|
<div class={ move || if opener.visible() {"modal fade show"} else {"modal fade"}}
|
|
|
|
<div class={ move || if opener.visible() {"modal fade show"} else {"modal fade"}}
|
|
|
|
style={ move || if opener.visible() {"display: block;"} else {""}}
|
|
|
|
style={ move || if opener.visible() {"display: block;"} else {""}}
|
|
|
@ -44,7 +43,7 @@ pub fn ModalDialog(
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h5 class="modal-title" id="modalCenterTitle">{title}</h5>
|
|
|
|
<h5 class="modal-title" id="modalCenterTitle">{trl(cx, title)}</h5>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
|
class="btn-close"
|
|
|
|
class="btn-close"
|
|
|
|