Skip to content

Commit

Permalink
Merge pull request #1037 from karlhungus/svganimatedstring_no_className
Browse files Browse the repository at this point in the history
Fix: click on inline SVG in slide or controls causes error "SvgAnimatedString no className"
  • Loading branch information
dimsemenov committed Dec 3, 2015
2 parents 10dbbb7 + 3fa508e commit 84c0d4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/js/gestures.js
Expand Up @@ -79,12 +79,12 @@ var _gestureStartTime,

// find the closest parent DOM element
_closestElement = function(el, fn) {
if(!el) {
if(!el || el === document) {
return false;
}

// don't search elements above pswp__scroll-wrap
if(el.className && el.className.indexOf('pswp__scroll-wrap') > -1 ) {
if(el.getAttribute('class') && el.getAttribute('class').indexOf('pswp__scroll-wrap') > -1 ) {
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions src/js/ui/photoswipe-ui-default.js
Expand Up @@ -115,7 +115,7 @@ var PhotoSwipeUI_Default =

var target = e.target || e.srcElement,
uiElement,
clickedClass = target.className,
clickedClass = target.getAttribute('class') || '',
found;

for(var i = 0; i < _uiElements.length; i++) {
Expand Down Expand Up @@ -572,8 +572,8 @@ var PhotoSwipeUI_Default =
var t = e.target || e.srcElement;
if(
t &&
t.className && e.type.indexOf('mouse') > -1 &&
( t.className.indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) )
t.getAttribute('class') && e.type.indexOf('mouse') > -1 &&
( t.getAttribute('class').indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) )
) {
preventObj.prevent = false;
}
Expand Down Expand Up @@ -855,4 +855,4 @@ var PhotoSwipeUI_Default =
return PhotoSwipeUI_Default;


});
});

0 comments on commit 84c0d4a

Please sign in to comment.