Skip to content

Commit 6936bfc

Browse files
authored
Merge pull request #293 from eduardomozart/patch-5
Open links on a new tab when Ctrl (Win) / Command (macOS) key is pressed
2 parents 6347611 + 96663fa commit 6936bfc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

script.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,13 @@ jQuery(function(){ // on page load
211211
}
212212

213213
if(node.data.url){
214-
window.location.href = node.data.url;
214+
if (e.ctrlKey || e.metaKey) {
215+
e.stopPropagation();
216+
e.preventDefault();
217+
window.open(node.data.url);
218+
} else {
219+
window.location.href = node.data.url;
220+
}
215221
}
216222
},
217223

0 commit comments

Comments
 (0)