web: only use one view function, desktop/tablet/mobile handled in CSS

This commit is contained in:
2025-01-26 09:31:44 -08:00
parent ea280dd366
commit 25d31a6ce7
5 changed files with 131 additions and 249 deletions

View File

@@ -507,6 +507,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
});
}
Msg::WindowScrolled => {
info!("WindowScrolled");
if let Some(el) = model.content_el.get() {
let ih = window()
.inner_height()
@@ -515,6 +516,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
.value_of();
let r = el.get_bounding_client_rect();
info!("r {r:?} ih {ih}");
if r.height() < ih {
// The whole content fits in the window, no scrollbar
orders.send_msg(Msg::SetProgress(0.));