Skip to content

Commit ff0abd8

Browse files
ENGCOM-8407: Avoid binding magnifier events in duplicate on resize #30695
2 parents 39796f9 + 9d8c91c commit ff0abd8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/web/magnifier/magnifier.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,13 @@
401401
}
402402

403403
function bindEvents(eType, thumb) {
404+
var eventFlag = 'hasBoundEvent_' + eType;
405+
if (thumb[eventFlag]) {
406+
// Events are already bound, no need to bind in duplicate
407+
return;
408+
}
409+
thumb[eventFlag] = true;
410+
404411
switch (eType) {
405412
case 'hover':
406413
hoverEvents(thumb);

0 commit comments

Comments
 (0)