aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-diff-filetree.js
blob: 9eba3cf8879a4a1cf025574ac2dc19ad0a6f167f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}