From 4f0962cbf307f81f310d1632435c89ee2ee1bc52 Mon Sep 17 00:00:00 2001 From: Robert Perce Date: Wed, 8 Apr 2026 11:38:05 -0500 Subject: [PATCH] feat: sidebar scrolling works on mobile --- src/web/auth.rs | 4 ++-- src/web/contact/mod.rs | 2 +- static/index.css | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/web/auth.rs b/src/web/auth.rs index 0ce501d..1416511 100644 --- a/src/web/auth.rs +++ b/src/web/auth.rs @@ -96,13 +96,13 @@ mod get { } body hx-ext="response-targets" { h1 { "Mascarpone" } - form hx-post=(post_url) hx-target-error="#error" x-data="{ user: '', pass: '' }" { + form hx-post=(post_url) hx-target-error="#error" x-data="{ user: '', pass: '', htmx: false }" "x-on:htmx:load.document"="htmx = true" { label for="username" { "Username" } input name="username" #username autofocus x-model="user" x-cloak; label for="password" { "Password" } input name="password" #password type="password" x-model="pass" x-cloak; - input type="submit" value="login" x-bind:disabled="!(user.length && pass.length)"; + input type="submit" value="login" x-bind:disabled="!(user.length && pass.length && htmx)" hx-disabled-elt; #error {} } } diff --git a/src/web/contact/mod.rs b/src/web/contact/mod.rs index d9a291a..d3a3cca 100644 --- a/src/web/contact/mod.rs +++ b/src/web/contact/mod.rs @@ -70,7 +70,7 @@ mod get { ?.top;\ top&&document\ .getElementById('contacts-sidebar')\ - .scrollTo({{top:top+window.innerHeight/2,left:0,behavior:'instant'}});", + .scrollTo({{top:top-window.innerHeight/2,left:0,behavior:'instant'}});", id ) } diff --git a/static/index.css b/static/index.css index e2941b3..d6b1520 100644 --- a/static/index.css +++ b/static/index.css @@ -57,7 +57,8 @@ section#content { height: 100%; &.hide { - display: none; + left: -200%; + visibility: hidden; } }