diff --git a/addons/photoswipe/rx_photoswipe.js b/addons/photoswipe/rx_photoswipe.js index 62621c673..4dbf8bf7c 100644 --- a/addons/photoswipe/rx_photoswipe.js +++ b/addons/photoswipe/rx_photoswipe.js @@ -63,9 +63,6 @@ var initPhotoSwipeFromDOM = function(gallerySelector) { // triggers when user clicks on thumbnail var onThumbnailsClick = function(e) { - e = e || window.event; - e.preventDefault ? e.preventDefault() : e.returnValue = false; - var eTarget = e.target || e.srcElement; // find root element of slide @@ -76,6 +73,9 @@ var initPhotoSwipeFromDOM = function(gallerySelector) { if(!clickedListItem) { return; } + + e = e || window.event; + e.preventDefault ? e.preventDefault() : e.returnValue = false; // find index of clicked item by looping through all child nodes // alternatively, you may define index via data- attribute