Preserve explorer scroll position

This commit is contained in:
Mikei386
2026-06-22 23:02:02 +02:00
parent 9764421e13
commit b0643f979f
5 changed files with 10 additions and 4 deletions
+7 -1
View File
@@ -151,6 +151,12 @@ function renderWindow(win) {
if (win.kind === 'explorer') renderExplorer(body, win);
if (win.kind === 'properties') renderProperties(body);
if (win.kind === 'queue') renderQueue(body);
body.scrollTop = win.data.scrollTop || 0;
body.scrollLeft = win.data.scrollLeft || 0;
body.addEventListener('scroll', () => {
win.data.scrollTop = body.scrollTop;
win.data.scrollLeft = body.scrollLeft;
});
el.append(titlebar, body);
if (!win.maximized) {
@@ -249,7 +255,7 @@ function renderFileTable(entries) {
}
const rows = entries.map((entry) => `
<tr class="file-row" draggable="true" data-path="${escapeAttr(entry.path)}">
<tr class="file-row ${entry.path === state.selectedEntry?.path ? 'selected' : ''}" draggable="true" data-path="${escapeAttr(entry.path)}">
<td><span class="name-cell"><span class="badge">${icons[entry.type] || 'Item'}</span>${escapeHtml(entry.name)}</span></td>
<td>${entry.type}</td>
<td>${entry.type === 'file' ? formatBytes(entry.size) : ''}</td>