refactor: Extract modal backdrop close and scrollToTop to functions

- Add closeOnBackdrop(modal, evt) to utils._hs for modal backdrop clicks
- Add scrollToTop(evt) to utils._hs for smooth scroll to top
- Simplify 3 modal templates (shortcuts, info, pdf) from 4 lines to 1
- Simplify back-to-top button from 3 lines to 1
This commit is contained in:
juanatsap
2025-11-30 06:33:42 +00:00
parent 74bb3747a9
commit fd734635d9
5 changed files with 23 additions and 15 deletions
+1 -4
View File
@@ -1,10 +1,7 @@
{{define "pdf-modal"}}
<!-- PDF Download Modal - Interactive Thumbnails -->
<dialog id="pdf-modal" class="info-modal pdf-download-modal no-print"
_="on click
if event.target is me
call me.close()
end">
_="on click call closeOnBackdrop(me, event)">
<div class="info-modal-content" id="pdf-modal-content">
<!-- Loading Overlay -->
<div class="pdf-loading-overlay" id="pdf-loading-overlay">