Skip to content

Commit d1c5ccf

Browse files
committed
Multiple errors are displayed in Console when switching images in mobile view-addevent passive listener fixes for touchstart mobile event
1 parent 8c1744d commit d1c5ccf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/web/fotorama/fotorama.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ fotoramaVersion = '4.6.4';
11401140

11411141
function addEvent(el, e, fn, bool) {
11421142
if (!e) return;
1143-
el.addEventListener ? el.addEventListener(e, fn, {passive: true}) : el.attachEvent('on' + e, fn);
1143+
el.addEventListener ? el.addEventListener(e, fn, !!bool) : el.attachEvent('on' + e, fn);
11441144
}
11451145

11461146
/**
@@ -1519,7 +1519,7 @@ fotoramaVersion = '4.6.4';
15191519
addEvent(el, 'touchmove', onMove);
15201520
addEvent(el, 'touchend', onEnd);
15211521

1522-
addEvent(document, 'touchstart', onOtherStart);
1522+
addEvent(document, 'touchstart', onOtherStart, true);
15231523
addEvent(document, 'touchend', onOtherEnd);
15241524
addEvent(document, 'touchcancel', onOtherEnd);
15251525

0 commit comments

Comments
 (0)