From 9b518676ae4b9a9cdfdd0f7a956e714cdc001084 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 13 Feb 2013 04:54:16 +0000 Subject: [PATCH] only click on links, fixes #1245 --- static/js/pandora/utils.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index ded8e224..64fb73be 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -218,15 +218,13 @@ pandora.clickLink = function(e) { pandora.createLinks = function($element) { function isExternalLink(target) { - return $(target).is('a') && ( - target.hostname != document.location.hostname - || Ox.startsWith(target.pathname, '/static') - ) + return target.hostname != document.location.hostname + || Ox.startsWith(target.pathname, '/static'); } $element .on({ click: function(e) { - if(isExternalLink(e.target)) { + if($(e.target).is('a') && isExternalLink(e.target)) { e.preventDefault(); window.open('/url=' + encodeURIComponent(e.target.href), '_blank'); } @@ -235,7 +233,7 @@ pandora.createLinks = function($element) { }) .bindEvent({ singleclick: function(e) { - if(!isExternalLink(e.target)) { + if($(e.target).is('a') && !isExternalLink(e.target)) { pandora.clickLink(e); } }