{{template "repo/header" .}}
@@ -16,13 +23,6 @@ {{template "repo/code/recently_pushed_new_branches" .}} - {{$treeNamesLen := len .TreeNames}} - {{$isTreePathRoot := eq $treeNamesLen 0}} - {{$showSidebar := $isTreePathRoot}} - {{$hasTreeSidebar := not $isTreePathRoot}} - {{$showTreeSidebar := .RepoPreferences.ShowFileViewTreeSidebar}} - {{$hideTreeSidebar := not $showTreeSidebar}} - {{$hasAndShowTreeSidebar := and $hasTreeSidebar $showTreeSidebar}}
{{if $hasTreeSidebar}}
{{template "repo/view_file_tree_sidebar" .}}
diff --git a/web_src/js/components/ViewFileTree.vue b/web_src/js/components/ViewFileTree.vue index 605314027c..3337f6e9e5 100644 --- a/web_src/js/components/ViewFileTree.vue +++ b/web_src/js/components/ViewFileTree.vue @@ -3,15 +3,16 @@ import ViewFileTreeItem from './ViewFileTreeItem.vue'; defineProps<{ files: any, - selectedItem: string, + selectedItem: any, loadChildren: any, + loadContent: any; }>(); diff --git a/web_src/js/components/ViewFileTreeItem.vue b/web_src/js/components/ViewFileTreeItem.vue index 0df09613bc..db2e888fdd 100644 --- a/web_src/js/components/ViewFileTreeItem.vue +++ b/web_src/js/components/ViewFileTreeItem.vue @@ -12,13 +12,14 @@ type Item = { const props = defineProps<{ item: Item, + loadContent: any; loadChildren: any; - selectedItem?: string; + selectedItem?: any; }>(); const isLoading = ref(false); -const collapsed = ref(!props.item.children); const children = ref(props.item.children); +const collapsed = ref(!props.item.children); const doLoadChildren = async () => { collapsed.value = !collapsed.value; @@ -32,11 +33,11 @@ const doLoadChildren = async () => { const doLoadDirContent = () => { doLoadChildren(); - window.location.href = props.item.htmlUrl; + props.loadContent(props.item); }; const doLoadFileContent = () => { - window.location.href = props.item.htmlUrl; + props.loadContent(props.item); }; @@ -44,7 +45,7 @@ const doLoadFileContent = () => {
@@ -54,7 +55,7 @@ const doLoadFileContent = () => {
@@ -66,7 +67,7 @@ const doLoadFileContent = () => {
- +