Skip to content

Commit

Permalink
Fix missing video when advanced js bundling used
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-sviziev committed Mar 16, 2021
1 parent 592c792 commit 4d5d656
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ define([
* @private
*/
_create: function () {
$(this.element).on('gallery:loaded', $.proxy(function () {
this.fotoramaItem = $(this.element).find('.fotorama-item');
this._initialize();
}, this));
$(this.element).data('gallery') ?
this._onGalleryLoaded() :
$(this.element).on('gallery:loaded', this._onGalleryLoaded.bind(this));
},

/**
Expand Down Expand Up @@ -171,6 +170,14 @@ define([
}
},

/**
* Callback which fired after gallery gets initialized.
*/
_onGalleryLoaded: function () {
this.fotoramaItem = $(this.element).find('.fotorama-item');
this._initialize();
},

/**
* Clear gallery events to prevent duplicated calls.
*
Expand Down

0 comments on commit 4d5d656

Please sign in to comment.