diff options
author | Drew DeVault <sir@cmpwn.com> | 2020-11-19 11:41:47 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-11-19 11:41:47 -0500 |
commit | 51498a2dc37987f55b022efb961b68a282be17ed (patch) | |
tree | 6563108dc40f0ed3455b1f80c3f283ff235ff18e /themes/alps | |
parent | a1e8bcc5619040ede66f7d53e6acf9df61870609 (diff) | |
download | alps-51498a2dc37987f55b022efb961b68a282be17ed.tar.gz alps-51498a2dc37987f55b022efb961b68a282be17ed.zip |
JS enhancements to encourage bottom-posting
Diffstat (limited to 'themes/alps')
-rw-r--r-- | themes/alps/assets/compose.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/themes/alps/assets/compose.js b/themes/alps/assets/compose.js index a980d77..23e67b6 100644 --- a/themes/alps/assets/compose.js +++ b/themes/alps/assets/compose.js @@ -1,3 +1,11 @@ +const textarea = document.querySelector("textarea.body"); +if (window.location.pathname.endsWith("/reply")) { + // Auto-focus body and scroll to bottom + textarea.focus(); + textarea.setSelectionRange(textarea.value.length, textarea.value.length); + textarea.scrollTop = textarea.scrollHeight; +} + const sendButton = document.getElementById("send-button"), saveButton = document.getElementById("save-button"); |