navigatie aangepast
This commit is contained in:
+17
-1
@@ -683,6 +683,17 @@ function currentParentPath(path) {
|
||||
return segments.slice(0, -1).join("/");
|
||||
}
|
||||
|
||||
function navigateToParent(pane) {
|
||||
const model = paneState(pane);
|
||||
const childPath = model.currentPath;
|
||||
const parentPath = currentParentPath(childPath);
|
||||
if (!parentPath) {
|
||||
return;
|
||||
}
|
||||
model.pendingSelectionPath = childPath;
|
||||
navigateTo(pane, parentPath);
|
||||
}
|
||||
|
||||
function baseName(path) {
|
||||
const index = path.lastIndexOf("/");
|
||||
return index >= 0 ? path.slice(index + 1) : path;
|
||||
@@ -890,7 +901,7 @@ function renderPaneItems(pane) {
|
||||
upName.onclick = (ev) => {
|
||||
ev.stopPropagation();
|
||||
setActivePane(pane);
|
||||
navigateTo(pane, entry.path);
|
||||
navigateToParent(pane);
|
||||
};
|
||||
upName.classList.add("entry-label");
|
||||
upNameCell.append(upName);
|
||||
@@ -2440,6 +2451,11 @@ function handleKeyboardShortcuts(event) {
|
||||
setActivePane(otherPane(state.activePane));
|
||||
return;
|
||||
}
|
||||
if (event.key === "Backspace") {
|
||||
event.preventDefault();
|
||||
navigateToParent(state.activePane);
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowUp") {
|
||||
if (event.shiftKey) {
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user