This commit is contained in:
@@ -150,11 +150,13 @@
|
|||||||
if (parentPath === '') parentPath = '/';
|
if (parentPath === '') parentPath = '/';
|
||||||
|
|
||||||
const tr = document.createElement('tr');
|
const tr = document.createElement('tr');
|
||||||
|
tr.className = 'file-row';
|
||||||
|
tr.onclick = () => enterDir(parentPath);
|
||||||
tr.innerHTML = `
|
tr.innerHTML = `
|
||||||
|
<td></td>
|
||||||
<td class="icon-col"><i class="fa-solid fa-arrow-turn-up text-secondary"></i></td>
|
<td class="icon-col"><i class="fa-solid fa-arrow-turn-up text-secondary"></i></td>
|
||||||
<td>..</td>
|
<td>..</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
|
||||||
<td class="text-end"></td>
|
<td class="text-end"></td>
|
||||||
`;
|
`;
|
||||||
tbody.appendChild(tr);
|
tbody.appendChild(tr);
|
||||||
@@ -193,18 +195,14 @@
|
|||||||
|
|
||||||
// Row click should not trigger when clicking on interactive elements
|
// Row click should not trigger when clicking on interactive elements
|
||||||
tr.addEventListener('click', (e) => {
|
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) {
|
if (file.is_dir) {
|
||||||
enterDir(file.path);
|
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);
|
tbody.appendChild(tr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user