From da518d7a12473fe0810851cdaf2c4969aeb734bc Mon Sep 17 00:00:00 2001 From: Dominic Ferrando Date: Thu, 24 Apr 2025 20:58:51 -0400 Subject: [PATCH] Scrolling and focus convienence for new post form --- web/views/thread.templ | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/views/thread.templ b/web/views/thread.templ index 2820a5b..d81284f 100644 --- a/web/views/thread.templ +++ b/web/views/thread.templ @@ -106,7 +106,9 @@ templ PostOriginal(post database.Post, thread database.Thread) { { post.CreatedAt.Format("01/02/2006") } { post.CreatedAt.Format("15:04") } >%d\n'", post.Number) } + _={ fmt.Sprintf(` + on click set #newPostBody.value to #newPostBody.value + '>>%d\n' + then call #newPostBody.focus()`, post.Number) } class=" post-num" > No.{ strconv.Itoa(post.Number) } @@ -137,7 +139,10 @@ templ PostReply(post database.Post, threadContext ThreadContext) { { post.CreatedAt.Format("15:04") } >%d\n'", post.Number) } + _={ fmt.Sprintf(` + on click set #newPostBody.value to #newPostBody.value + '>>%d\n' + then call smoothScrollTo('top') + then call #newPostBody.focus()`, post.Number) } class=" post-num" > No.{ strconv.Itoa(post.Number) }