Skip to content

Commit

Permalink
feat: left jump to parent (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Nov 15, 2023
1 parent 592a9f4 commit 6b91f3e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@
$selected.expanded = true;
$selected.invalidate();
} else if (key === 'ArrowLeft') {
$selected.expanded = false;
$selected.invalidate();
if ($selected.expanded) {
$selected.expanded = false;
return $selected.invalidate();
}
do $selected = $selected.parent ?? $selected;
while (!$visibility[$selected.type]);
} else if (key === 'ArrowUp') {
let nodes = ($selected.parent?.children || $root).filter((n) => $visibility[n.type]);
let sibling = nodes[nodes.findIndex((o) => o.id === $selected?.id) - 1];
Expand Down

0 comments on commit 6b91f3e

Please sign in to comment.