Preserve explorer scroll position
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user