0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-28 20:32:56 +01:00
gitea/web_src/js/features/repo-diff-filetree.js
a1012112796 2a99607add
make show stats work when only one file changed (#32244) (#32268)
Backport #32244

fix https://github.com/go-gitea/gitea/issues/32226

in https://github.com/go-gitea/gitea/pull/27775 , it do some changes to
only show diff file tree when more than one file changed. But looks it
also break the `diff-file-list` logic, which looks not expected change.
so try fix it.

/cc @silverwind

example view:

![image](https://github.com/user-attachments/assets/281e9c4f-a269-4d36-94eb-a132058aea87)

Signed-off-by: a1012112796 <1012112796@qq.com>
2024-10-17 08:03:21 +00:00

19 lines
568 B
JavaScript

import {createApp} from 'vue';
import DiffFileTree from '../components/DiffFileTree.vue';
import DiffFileList from '../components/DiffFileList.vue';
export function initDiffFileTree() {
const el = document.getElementById('diff-file-tree');
if (!el) return;
const fileTreeView = createApp(DiffFileTree);
fileTreeView.mount(el);
}
export function initDiffFileList() {
const fileListElement = document.getElementById('diff-file-list');
if (!fileListElement) return;
const fileListView = createApp(DiffFileList);
fileListView.mount(fileListElement);
}