Skip to content

Commit eec1be5

Browse files
committed
AC-12124: [Random Bug] Fotorama lib isn't loaded
Check for multiple instances of jQuery. Try to use the global jQuery instance
1 parent f309978 commit eec1be5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/web/mage/gallery/gallery.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ define([
120120
config.options.swipe = true;
121121
this.config = config;
122122

123+
// Check for multiple instances of jQuery
124+
if (typeof jQuery !== 'undefined' && jQuery !== $ && typeof $.fn.fotorama === 'undefined') {
125+
// Try to use the global jQuery instance
126+
if (typeof window.jQuery !== 'undefined') {
127+
$ = jQuery.noConflict();
128+
}
129+
}
130+
123131
this.settings = {
124132
$element: $(element),
125133
$pageWrapper: $('.page-wrapper'),

0 commit comments

Comments
 (0)