From 5028a2439e3fc1e977b91a94db25b5b3a96b1f02 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 6 Feb 2026 11:47:09 +0000 Subject: [PATCH] fix --- templates/index.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/templates/index.html b/templates/index.html index ccec983..5007c25 100644 --- a/templates/index.html +++ b/templates/index.html @@ -150,11 +150,13 @@ if (parentPath === '') parentPath = '/'; const tr = document.createElement('tr'); + tr.className = 'file-row'; + tr.onclick = () => enterDir(parentPath); tr.innerHTML = ` + .. - `; tbody.appendChild(tr); @@ -193,18 +195,14 @@ // Row click should not trigger when clicking on interactive elements tr.addEventListener('click', (e) => { - if (e.target.matches('input, button, a, i')) return; // Ignore clicks on actions/checkboxes + // Ignore clicks on actions, checkboxes, or links + if (e.target.closest('button, a, input')) return; + if (file.is_dir) { enterDir(file.path); } }); - // Make the text part of the cell clickable for directory navigation - const fileNameCell = tr.querySelector('.file-name-cell'); - if(file.is_dir) { - fileNameCell.classList.add('file-row'); - fileNameCell.onclick = () => enterDir(file.path); - } tbody.appendChild(tr); }); }