Skip to content

Commit ae741ad

Browse files
MAGETWO-85096: [Backport 2.3] Added namespace to product videos fotorama events #12556
2 parents 2263927 + 83bcf26 commit ae741ad

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ define([
173173
*/
174174
clearEvents: function () {
175175
this.fotoramaItem.off(
176-
'fotorama:show ' +
177-
'fotorama:showend ' +
178-
'fotorama:fullscreenenter ' +
179-
'fotorama:fullscreenexit'
176+
'fotorama:show.' + this.PV +
177+
' fotorama:showend.' + this.PV +
178+
' fotorama:fullscreenenter.' + this.PV +
179+
' fotorama:fullscreenexit.' + this.PV
180180
);
181181
},
182182

@@ -205,7 +205,7 @@ define([
205205
if (options.dataMergeStrategy === 'prepend') {
206206
this.options.videoData = [].concat(
207207
this.options.optionsVideoData[options.selectedOption],
208-
this.options.videoData
208+
this.defaultVideoData
209209
);
210210
} else {
211211
this.options.videoData = this.options.optionsVideoData[options.selectedOption];
@@ -230,11 +230,11 @@ define([
230230
* @private
231231
*/
232232
_listenForFullscreen: function () {
233-
this.fotoramaItem.on('fotorama:fullscreenenter', $.proxy(function () {
233+
this.fotoramaItem.on('fotorama:fullscreenenter.' + this.PV, $.proxy(function () {
234234
this.isFullscreen = true;
235235
}, this));
236236

237-
this.fotoramaItem.on('fotorama:fullscreenexit', $.proxy(function () {
237+
this.fotoramaItem.on('fotorama:fullscreenexit.' + this.PV, $.proxy(function () {
238238
this.isFullscreen = false;
239239
this._hideVideoArrows();
240240
}, this));
@@ -466,7 +466,7 @@ define([
466466
t;
467467

468468
if (!fotorama.activeFrame.$navThumbFrame) {
469-
this.fotoramaItem.on('fotorama:showend', $.proxy(function (evt, fotoramaData) {
469+
this.fotoramaItem.on('fotorama:showend.' + this.PV, $.proxy(function (evt, fotoramaData) {
470470
$(fotoramaData.activeFrame.$stageFrame).removeAttr('href');
471471
}, this));
472472

@@ -484,7 +484,7 @@ define([
484484
this._checkForVideo(e, fotorama, t + 1);
485485
}
486486

487-
this.fotoramaItem.on('fotorama:showend', $.proxy(function (evt, fotoramaData) {
487+
this.fotoramaItem.on('fotorama:showend.' + this.PV, $.proxy(function (evt, fotoramaData) {
488488
$(fotoramaData.activeFrame.$stageFrame).removeAttr('href');
489489
}, this));
490490
},
@@ -526,15 +526,15 @@ define([
526526
* @private
527527
*/
528528
_attachFotoramaEvents: function () {
529-
this.fotoramaItem.on('fotorama:showend', $.proxy(function (e, fotorama) {
529+
this.fotoramaItem.on('fotorama:showend.' + this.PV, $.proxy(function (e, fotorama) {
530530
this._startPrepareForPlayer(e, fotorama);
531531
}, this));
532532

533-
this.fotoramaItem.on('fotorama:show', $.proxy(function (e, fotorama) {
533+
this.fotoramaItem.on('fotorama:show.' + this.PV, $.proxy(function (e, fotorama) {
534534
this._unloadVideoPlayer(fotorama.activeFrame.$stageFrame.parent(), fotorama, true);
535535
}, this));
536536

537-
this.fotoramaItem.on('fotorama:fullscreenexit', $.proxy(function (e, fotorama) {
537+
this.fotoramaItem.on('fotorama:fullscreenexit.' + this.PV, $.proxy(function (e, fotorama) {
538538
fotorama.activeFrame.$stageFrame.find('.' + this.PV).remove();
539539
this._startPrepareForPlayer(e, fotorama);
540540
}, this));

0 commit comments

Comments
 (0)