Created
November 26, 2013 13:49
-
-
Save koenongena/7658517 to your computer and use it in GitHub Desktop.
clickable row in JS
This file contains 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
this.el.click(function (e) { | |
var elem, evt = e ? e:event; | |
if (evt.srcElement){elem = evt.srcElement;} | |
else if (evt.target){elem = evt.target;} | |
if (elem.tagName.toUpperCase() == 'A'){ | |
return; | |
} | |
var url = $(this).find("a" + (linkSelector||':first')).attr('href'); | |
if (e.ctrlKey) { | |
var win = window.open(url, "_blank"); | |
win.focus(); | |
e._preventDefault(); | |
} else { | |
window.location.href = url; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment