Skip to content

Commit

Permalink
minimap: attempt to navigate page
Browse files Browse the repository at this point in the history
  • Loading branch information
Wattenberger committed Dec 2, 2021
1 parent 3766a4a commit 74fb7b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/blocks/folder-blocks/minimap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export default function (props: FolderBlockProps) {
}} >
<Tree
data={data}
onClickFile={(path: string) => {
if ('URLSearchParams' in window) {
var searchParams = new URLSearchParams(window.location.search);
searchParams.set("path", path);
var newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();
history.pushState(null, '', newRelativePathQuery);
}
}}
/>
</div>
);
Expand Down

0 comments on commit 74fb7b9

Please sign in to comment.