mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 01:22:21 +00:00
31f934c1d8
This PR adds a filetree to the left side of the files/diff view. Initially the filetree will not be shown and may be shown via a new "Show file tree" button. Showing and hiding is using the same icon as github. Folders are collapsible. On small devices (max-width 991 PX) the file tree will be hidden. Close #18192 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
22 lines
655 B
JavaScript
22 lines
655 B
JavaScript
import Vue from 'vue';
|
|
import DiffFileTree from '../components/DiffFileTree.vue';
|
|
import DiffFileList from '../components/DiffFileList.vue';
|
|
|
|
export default function initDiffFileTree() {
|
|
const el = document.getElementById('diff-file-tree-container');
|
|
if (!el) return;
|
|
|
|
const View = Vue.extend({
|
|
render: (createElement) => createElement(DiffFileTree),
|
|
});
|
|
new View().$mount(el);
|
|
|
|
const fileListElement = document.getElementById('diff-file-list-container');
|
|
if (!fileListElement) return;
|
|
|
|
const fileListView = Vue.extend({
|
|
render: (createElement) => createElement(DiffFileList),
|
|
});
|
|
new fileListView().$mount(fileListElement);
|
|
}
|