Skip to content

Commit

Permalink
Fix ctrl/cmd click issue
Browse files Browse the repository at this point in the history
We want ctrl/cmd click to open the window in a new tab
  • Loading branch information
greggman committed May 28, 2024
1 parent 9d382a3 commit 91da5e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ <h1><a href="/">~</a>{linked-path}</h1>
if (tr) {
var a = tr.querySelector('a');
if (a) {
window.location.href = a.href;
if (e.metaKey || e.ctrlKey) {
e.preventDefault();
window.open(a.href, '_blank');
} else {
a.click();
}
}
}
});
Expand Down

0 comments on commit 91da5e5

Please sign in to comment.