Skip to content

Commit

Permalink
Merge pull request #293 from eduardomozart/patch-5
Browse files Browse the repository at this point in the history
Open links on a new tab when Ctrl (Win) / Command (macOS) key is pressed
  • Loading branch information
Klap-in authored Feb 1, 2024
2 parents 6347611 + 96663fa commit 6936bfc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ jQuery(function(){ // on page load
}

if(node.data.url){
window.location.href = node.data.url;
if (e.ctrlKey || e.metaKey) {
e.stopPropagation();
e.preventDefault();
window.open(node.data.url);
} else {
window.location.href = node.data.url;
}
}
},

Expand Down

0 comments on commit 6936bfc

Please sign in to comment.