Skip to content

Commit b594f38

Browse files
MAGETWO-85097: [Backport-2.1] Added namespace to product videos fotorama events #12558
- Merge Pull Request #12558 from roma84/magento2:2.1-fix-product-videos-gallery-events - Merged commits: 1. 183e4d6 2. 5dbfa14
2 parents acfceb8 + 5dbfa14 commit b594f38

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
@@ -175,10 +175,10 @@ define([
175175
*/
176176
clearEvents: function () {
177177
this.fotoramaItem.off(
178-
'fotorama:show ' +
179-
'fotorama:showend ' +
180-
'fotorama:fullscreenenter ' +
181-
'fotorama:fullscreenexit'
178+
'fotorama:show.' + this.PV +
179+
' fotorama:showend.' + this.PV +
180+
' fotorama:fullscreenenter.' + this.PV +
181+
' fotorama:fullscreenexit.' + this.PV
182182
);
183183
},
184184

@@ -207,7 +207,7 @@ define([
207207
if (options.dataMergeStrategy === 'prepend') {
208208
this.options.videoData = [].concat(
209209
this.options.optionsVideoData[options.selectedOption],
210-
this.options.videoData
210+
this.defaultVideoData
211211
);
212212
} else {
213213
this.options.videoData = this.options.optionsVideoData[options.selectedOption];
@@ -232,11 +232,11 @@ define([
232232
* @private
233233
*/
234234
_listenForFullscreen: function () {
235-
this.fotoramaItem.on('fotorama:fullscreenenter', $.proxy(function () {
235+
this.fotoramaItem.on('fotorama:fullscreenenter.' + this.PV, $.proxy(function () {
236236
this.isFullscreen = true;
237237
}, this));
238238

239-
this.fotoramaItem.on('fotorama:fullscreenexit', $.proxy(function () {
239+
this.fotoramaItem.on('fotorama:fullscreenexit.' + this.PV, $.proxy(function () {
240240
this.isFullscreen = false;
241241
this._hideVideoArrows();
242242
}, this));
@@ -468,7 +468,7 @@ define([
468468
t;
469469

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

@@ -486,7 +486,7 @@ define([
486486
this._checkForVideo(e, fotorama, t + 1);
487487
}
488488

489-
this.fotoramaItem.on('fotorama:showend', $.proxy(function (evt, fotoramaData) {
489+
this.fotoramaItem.on('fotorama:showend.' + this.PV, $.proxy(function (evt, fotoramaData) {
490490
$(fotoramaData.activeFrame.$stageFrame).removeAttr('href');
491491
}, this));
492492
},
@@ -528,15 +528,15 @@ define([
528528
* @private
529529
*/
530530
_attachFotoramaEvents: function () {
531-
this.fotoramaItem.on('fotorama:showend', $.proxy(function (e, fotorama) {
531+
this.fotoramaItem.on('fotorama:showend.' + this.PV, $.proxy(function (e, fotorama) {
532532
this._startPrepareForPlayer(e, fotorama);
533533
}, this));
534534

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

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

0 commit comments

Comments
 (0)