Skip to content

Commit 9c4a8e2

Browse files
committed
add aux click check to doLoadDirContent
1 parent 10d9471 commit 9c4a8e2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

web_src/js/components/ViewFileTreeItem.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ const doLoadChildren = async () => {
3535
}
3636
};
3737
38-
const doLoadDirContent = () => {
39-
doLoadChildren();
40-
props.navigateViewContent(props.item.fullPath);
38+
const doLoadDirContent = (event: MouseEvent) => {
39+
// open the directory in a new tab if either
40+
// - the auxiliary button (usually the mouse wheel button) is the origin of the click
41+
// - the ctrl key or meta key (for mac support) was pressed while clicking
42+
const openNewTab = event.button === 1 || event.ctrlKey || event.metaKey;
43+
if (!openNewTab) doLoadChildren();
44+
props.navigateViewContent(props.item.fullPath, openNewTab);
4145
};
4246
4347
const doLoadFileContent = (event: MouseEvent) => {
44-
// open the file in a new tab if either
45-
// - the auxiliary button (usually the mouse wheel button) is the origin of the click
46-
// - the ctrl key or meta key (for mac support) was pressed while clicking
4748
const openNewTab = event.button === 1 || event.ctrlKey || event.metaKey;
4849
props.navigateViewContent(props.item.fullPath, openNewTab);
4950
};
@@ -100,7 +101,7 @@ const doGotoSubModule = () => {
100101
:class="{'selected': selectedItem === item.fullPath}"
101102
:title="item.entryName"
102103
@click.stop="doLoadDirContent"
103-
@click.middle.stop="doLoadFileContent"
104+
@click.middle.stop="doLoadDirContent"
104105
>
105106
<!-- directory -->
106107
<div class="item-toggle">

0 commit comments

Comments
 (0)