Skip to content

Commit c6a89da

Browse files
committed
PB-266: Video background for Slide
1 parent 0c4bae0 commit c6a89da

File tree

3 files changed

+5
-17
lines changed
  • app/code/Magento/PageBuilder/view

3 files changed

+5
-17
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slide/preview.js

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/slide/preview.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,11 @@ export default class Preview extends BasePreview {
137137
super(contentType, config, observableUpdater);
138138

139139
this.contentType.dataStore.subscribe(this.buildJarallax);
140-
events.on("row:mountAfter", (args: ContentTypeReadyEventParamsInterface) => {
140+
events.on("slide:mountAfter", (args: ContentTypeReadyEventParamsInterface) => {
141141
if (args.id === this.contentType.id) {
142142
this.buildJarallax();
143143
}
144144
});
145-
events.on("contentType:mountAfter", (args: ContentTypeMountEventParamsInterface) => {
146-
if (args.contentType.parentContentType && args.contentType.parentContentType.id === this.contentType.id) {
147-
this.buildJarallax();
148-
}
149-
});
150145
}
151146

152147
/**

app/code/Magento/PageBuilder/view/base/web/js/content-type/slide/appearance/default/widget.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ define([
1111

1212
return function (config, element) {
1313
var videoElement = element[0].querySelector('[data-background-type=video]'),
14-
$slider = null,
15-
currentVideoSlide = null;
14+
$slider = null;
1615

1716
showOnHover(config);
1817

1918
if (videoElement) {
2019
$slider = $(element).closest('[data-content-type=slider]');
2120
videoBackground(config, videoElement);
2221
$slider.on('setPosition', function (event, slick) {
23-
currentVideoSlide = slick.$slides[slick.currentSlide].querySelector('.jarallax');
22+
var currentVideoSlide = slick.$slides[slick.currentSlide].querySelector('.jarallax');
2423

2524
if (currentVideoSlide.jarallax.options.videoPlayOnlyVisible) {
2625
currentVideoSlide.jarallax.video.play();
@@ -31,7 +30,7 @@ define([
3130
}
3231
});
3332
$slider.on('beforeChange', function (event, slick) {
34-
currentVideoSlide = slick.$slides[slick.currentSlide].querySelector('.jarallax');
33+
var currentVideoSlide = slick.$slides[slick.currentSlide].querySelector('.jarallax');
3534

3635
if (currentVideoSlide.jarallax.options.videoPlayOnlyVisible) {
3736
currentVideoSlide.jarallax.video.pause();

0 commit comments

Comments
 (0)