focus balk onder aan paneel

This commit is contained in:
kodi
2026-03-13 12:09:40 +01:00
parent 4ba4020c2a
commit bf4bb3d917
5 changed files with 38 additions and 0 deletions
+20
View File
@@ -910,6 +910,24 @@ function scrollCurrentRowIntoView(pane) {
}
}
function updatePaneFocusLine(pane) {
const model = paneState(pane);
const focusLine = document.getElementById(`${pane}-focus-line`);
if (!focusLine) {
return;
}
if (!Array.isArray(model.visibleItems) || model.currentRowIndex < 0 || model.currentRowIndex >= model.visibleItems.length) {
focusLine.textContent = "—";
return;
}
const item = model.visibleItems[model.currentRowIndex];
if (!item) {
focusLine.textContent = "—";
return;
}
focusLine.textContent = item.isParent ? "../" : (item.name || "—");
}
function renderPaneItems(pane) {
const model = paneState(pane);
const items = document.getElementById(`${pane}-items`);
@@ -917,6 +935,7 @@ function renderPaneItems(pane) {
if (!Array.isArray(model.visibleItems) || model.visibleItems.length === 0) {
model.currentRowIndex = -1;
updatePaneFocusLine(pane);
updateActionButtons();
return;
}
@@ -1039,6 +1058,7 @@ function renderPaneItems(pane) {
}
items.append(row);
});
updatePaneFocusLine(pane);
updateActionButtons();
}