Created
October 28, 2014 00:25
-
-
Save trevor-atlas/c903b48c8ee8480c4a20 to your computer and use it in GitHub Desktop.
restore middle click functionality on e.preventDefault() links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// allow command-click and control-click to open new tab | |
if (event.metaKey || event.ctrlKey) { | |
return; | |
} else { | |
event.preventDefault(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment