prevent popup blocker for external links

This commit is contained in:
j 2013-02-01 14:06:22 +00:00
parent bde4f97526
commit ca50e1dc54

View file

@ -219,7 +219,16 @@ pandora.clickLink = function(e) {
pandora.createLinks = function($element) { pandora.createLinks = function($element) {
$element $element
.on({ .on({
click: function() { click: function(e) {
if(
$(e.target).is('a') && (
e.target.hostname != document.location.hostname
|| Ox.startsWith(e.target.pathname, '/static')
)
) {
e.preventDefault();
window.open('/url=' + encodeURIComponent(e.target.href), '_blank');
}
return false; return false;
} }
}) })