Commit 9f2dc689 authored by Phil Hughes's avatar Phil Hughes

Allow rows in file table to be opened in new window

This allows rows in the Vue file tree refactor to be opened in a
window/tab
parent 7f936a16
...@@ -97,11 +97,13 @@ export default { ...@@ -97,11 +97,13 @@ export default {
}, },
}, },
methods: { methods: {
openRow() { openRow(e) {
if (this.isFolder) { if (e.target.tagName === 'A') return;
if (this.isFolder && !e.metaKey) {
this.$router.push(this.routerLinkTo); this.$router.push(this.routerLinkTo);
} else { } else {
visitUrl(this.url); visitUrl(this.url, e.metaKey);
} }
}, },
}, },
......
...@@ -104,7 +104,7 @@ describe('Repository table row component', () => { ...@@ -104,7 +104,7 @@ describe('Repository table row component', () => {
if (pushes) { if (pushes) {
expect(visitUrl).not.toHaveBeenCalled(); expect(visitUrl).not.toHaveBeenCalled();
} else { } else {
expect(visitUrl).toHaveBeenCalledWith('https://test.com'); expect(visitUrl).toHaveBeenCalledWith('https://test.com', undefined);
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment