prevent popup blocker for external links

This commit is contained in:
j 2013-02-01 14:06:22 +00:00
parent bde4f97526
commit ca50e1dc54
1 changed files with 10 additions and 1 deletions

View File

@ -219,7 +219,16 @@ pandora.clickLink = function(e) {
pandora.createLinks = function($element) {
$element
.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;
}
})