aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMedMan Dev <dev@medman.local>2026-10-30 16:17:48 +0000
committerMedMan Dev <dev@medman.local>2026-10-30 16:17:48 +0000
commit2ca2806ecef9c9727b7cbb34530e312fc555c92c (patch)
treeca73625855a23d04189bb23ffe498271ad79ce02
parentec5f9cf92d6553d8b80b313ef0628e44759dce8b (diff)
downloadmedman-2ca2806ecef9c9727b7cbb34530e312fc555c92c.tar.gz
Fix: don't reset scroll position when closing tag-assign dialogsHEADmaster
closeModal now only restores S._scrollTop for file previews (S.ph set). Selection/rename dialogs keep the current scroll position instead of jumping back to the top.
-rw-r--r--templates/index.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/templates/index.html b/templates/index.html
index 1b9cbe7..0099a88 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -978,11 +978,17 @@ document.getElementById('b-sel-clr').addEventListener('click',clearSel);
function closeModal(){
_clearNavKd();
_clearPrefetch();
+ const wasPreview = !!S.ph;
document.getElementById('prev-modal').classList.remove('on');
S.ph=null;
- requestAnimationFrame(()=>{
- document.getElementById('content').scrollTop=S._scrollTop||0;
- });
+ // Only restore the saved scroll position when closing a file preview.
+ // Selection/rename dialogs never move the scroll offset, so forcing
+ // S._scrollTop (which may be stale/0) would jump back to the top.
+ if(wasPreview){
+ requestAnimationFrame(()=>{
+ document.getElementById('content').scrollTop=S._scrollTop||0;
+ });
+ }
}
document.getElementById('m-close').addEventListener('click',closeModal);
document.getElementById('prev-modal').addEventListener('click',e=>{if(e.target===e.currentTarget)closeModal();});