You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converts the repo file tree items into `<a>` elements to have default
link behavior. Dynamic content load is still done when no special key is
pressed while clicking on an item.
---------
Co-authored-by: wxiaoguang <[email protected]>
if (e.state?.url) store.loadViewContent(e.state.url);
54
21
});
55
22
});
56
23
</script>
57
24
58
25
<template>
59
26
<divclass="view-file-tree-items"ref="elRoot">
60
-
<!-- only render the tree if we're visible. in many cases this is something that doesn't change very often -->
61
-
<ViewFileTreeItemv-for="item in files":key="item.name":item="item":selected-item="selectedItem":navigate-view-content="navigateTreeView":load-children="loadChildren"/>
27
+
<ViewFileTreeItemv-for="item in store.rootFiles":key="item.name":item="item":store="store"/>
// only handle the click event with page partial reloading if the user didn't press any special key
41
+
// let browsers handle special keys like "Ctrl+Click"
42
+
if (!isPlainClick(e)) return;
43
+
e.preventDefault();
44
+
if (props.item.entryMode==='tree') doLoadChildren();
45
+
store.navigateTreeView(props.item.fullPath);
41
46
};
42
47
43
-
const doLoadFileContent = () => {
44
-
props.navigateViewContent(props.item.fullPath);
45
-
};
46
-
47
-
const doGotoSubModule = () => {
48
-
location.href=props.item.submoduleUrl;
49
-
};
50
48
</script>
51
49
52
-
<!--title instead of tooltip above as the tooltip needs too much work with the current methods, i.e. not being loaded or staying open for "too long"-->
<ViewFileTreeItemv-for="childItem in children":key="childItem.entryName":item="childItem":selected-item="selectedItem":navigate-view-content="navigateViewContent":load-children="loadChildren"/>
76
+
<ViewFileTreeItemv-for="childItem in children":key="childItem.entryName":item="childItem":store="store"/>
0 commit comments