Skip to content

Commit 3966486

Browse files
committed
PB-95: Video background for Row
1 parent 1cabf98 commit 3966486

File tree

6 files changed

+46
-29
lines changed

6 files changed

+46
-29
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/row/_default.less

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,25 @@
1616
// Support for plugin github.com/bfred-it/object-fit-images
1717
// _________________________________________________________________
1818

19-
.jarallax > .jarallax-img {
20-
font-family: 'object-fit: cover;', sans-serif;
21-
height: 100%;
22-
left: 0;
23-
object-fit: cover;
24-
position: absolute;
25-
top: 0;
26-
width: 100%;
27-
z-index: -1;
19+
.jarallax {
20+
> .jarallax-img {
21+
font-family: 'object-fit: cover;', sans-serif;
22+
height: 100%;
23+
left: 0;
24+
object-fit: cover;
25+
position: absolute;
26+
top: 0;
27+
width: 100%;
28+
z-index: -1;
29+
}
2830
}
2931

3032
.video-overlay {
33+
bottom: 0;
34+
left: 0;
3135
position: absolute;
32-
top: 0; bottom: 0; left: 0; right: 0;
36+
right: 0;
37+
top: 0;
3338
z-index: -99;
3439
}
3540

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/validator-rules-mixin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ define([
166166
href = (href || '').replace(/^\s+/, '').replace(/\s+$/, '');
167167

168168
return validateIsUrl(href) && (
169-
href.match(/youtube\.com|youtu\.be/)
170-
|| href.match(/vimeo\.com/)
171-
|| href.match(/\.(mp4|ogv|webm)(?!\w)/)
169+
href.match(/youtube\.com|youtu\.be/) ||
170+
href.match(/vimeo\.com/) ||
171+
href.match(/\.(mp4|ogv|webm)(?!\w)/)
172172
);
173173
},
174174
$.mage.__('Please enter a valid video URL.')

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export default class Preview extends PreviewCollection {
4141
// Destroy all instances of the plugin prior
4242
try {
4343
// store/apply correct style after destroying, as jarallax incorrectly overrides it with stale value
44-
const style = this.element.getAttribute("style")
45-
|| this.element.getAttribute("data-jarallax-original-styles");
44+
const style = this.element.getAttribute("style") ||
45+
this.element.getAttribute("data-jarallax-original-styles");
4646
jarallax(this.element, "destroy");
4747
this.element.setAttribute("style", style);
4848
} catch (e) {

app/code/Magento/PageBuilder/view/base/web/css/source/jarallax/jarallax.less

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1+
// /**
2+
// * Copyright © Magento, Inc. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Jarallax styles
8+
// _________________________________________________________________
9+
110
& when (@media-common = true) {
211
.jarallax {
312
position: relative;
413
z-index: 0;
514
}
615

7-
.jarallax > .jarallax-img {
8-
// Support for plugin https://github.com/bfred-it/object-fit-images
9-
font-family: 'object-fit: cover;', sans-serif;
10-
height: 100%;
11-
left: 0;
12-
object-fit: cover;
13-
position: absolute;
14-
top: 0;
15-
width: 100%;
16-
z-index: -1;
16+
.jarallax{
17+
& > .jarallax-img {
18+
// Support for plugin https://github.com/bfred-it/object-fit-images
19+
font-family: 'object-fit: cover;', sans-serif;
20+
height: 100%;
21+
left: 0;
22+
object-fit: cover;
23+
position: absolute;
24+
top: 0;
25+
width: 100%;
26+
z-index: -1;
27+
}
1728
}
1829

1930
.jarallax-video-fallback {
@@ -22,11 +33,11 @@
2233

2334
.jarallax {
2435
.video-overlay {
25-
position: absolute;
26-
top: 0;
2736
bottom: 0;
2837
left: 0;
38+
position: absolute;
2939
right: 0;
40+
top: 0;
3041
z-index: -99;
3142
}
3243
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ define([
4040
videoLoop: $element.data('videoLoop'),
4141
videoPlayOnlyVisible: $element.data('videoPlayOnlyVisible'),
4242
disableVideo: false
43-
}
43+
};
4444
}
4545

4646
jarallaxConfig = jarallaxConfig || {

dev/tests/static/testsuite/Magento/Test/Integrity/Xml/ExtendsBaseFormTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ private function getXmlFiles(): array
6464
'pagebuilder_column_form.xml' => 'pagebuilder_base_form_with_background_attributes',
6565
'pagebuilder_slide_form.xml' => 'pagebuilder_base_form_with_background_attributes',
6666
'pagebuilder_tab_item_form.xml' => 'pagebuilder_base_form_with_background_attributes',
67-
'pagebuilder_row_form.xml' => 'pagebuilder_base_form_with_background_attributes',
67+
'pagebuilder_base_form_with_background_video.xml' => 'pagebuilder_base_form_with_background_attributes',
68+
'pagebuilder_row_form.xml' => 'pagebuilder_base_form_with_background_video',
6869
'pagebuilder_products_carousel_form.xml' => 'pagebuilder_products_form',
6970
];
7071
$componentRegistrar = new ComponentRegistrar();

0 commit comments

Comments
 (0)