2022-07-11 08:33:18 +02:00
|
|
|
///! Macros for the web UI
|
|
|
|
|
|
|
|
/// Adds a set of CSS classes to the body element when we're presenting a full-page form
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! add_body_form_classes {
|
|
|
|
() => {
|
|
|
|
for x in $crate::constants::CSS_CLASSES_BODY_FORM {
|
|
|
|
if let Err(e) = $crate::utils::body().class_list().add_1(x) {
|
2022-08-01 07:52:01 +02:00
|
|
|
console::error!(format!("class_list add error -> {:?}", e));
|
2022-07-11 08:33:18 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Removes the set of CSS classes from the body element after we're presenting a full-page form
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! remove_body_form_classes {
|
|
|
|
() => {
|
|
|
|
for x in $crate::constants::CSS_CLASSES_BODY_FORM {
|
|
|
|
if let Err(e) = $crate::utils::body().class_list().remove_1(x) {
|
2022-08-01 07:52:01 +02:00
|
|
|
console::error!(format!("class_list removal error -> {:?}", e));
|
2022-07-11 08:33:18 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|