Skip to content

Commit 99e8006

Browse files
committed
Merge branch 'MC-5419-bg-fixed' into cms-team-1-delivery
2 parents c3308cf + f024025 commit 99e8006

File tree

10 files changed

+67
-4
lines changed

10 files changed

+67
-4
lines changed

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBackgroundFormAttributeTests.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,6 +3235,7 @@
32353235
<actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/>
32363236
</before>
32373237
<after>
3238+
<resizeWindow width="1280" height="1024" stepKey="resizeWindowToDesktop"/>
32383239
<actionGroup ref="navigateToMediaGallery" stepKey="navigateToMediaGallery"/>
32393240
<actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="NavigateToFolder">
32403241
<argument name="FolderName" value="{{PageBuilderBackgroundImage_JPG.path}}"/>
@@ -3311,5 +3312,13 @@
33113312
<argument name="backgroundImage" value="PageBuilderBackgroundImage_JPG"/>
33123313
<argument name="pageNamePrefix" value="banner"/>
33133314
</actionGroup>
3315+
<resizeWindow width="767" height="1000" stepKey="resizeWindowToMobile"/>
3316+
<!-- Storefront: Check Background Attachment Mobile -->
3317+
<comment userInput="Storefront: Check Background Attachment Mobile" stepKey="commentStorefrontCheckMobile"/>
3318+
<executeJS function="return jQuery({{BannerOnFrontend.wrapperJS('1')}}).css('background-attachment')" stepKey="assignedBackgroundAttachment" />
3319+
<assertEquals stepKey="assertEqualToEnteredValue">
3320+
<expectedResult type="string">{{PageBuilderBackgroundAttachment_Scroll.value}}</expectedResult>
3321+
<actualResult type="variable">$assignedBackgroundAttachment</actualResult>
3322+
</assertEquals>
33143323
</test>
33153324
</tests>

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

Lines changed: 2 additions & 1 deletion
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/row/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default class Preview extends PreviewCollection {
4949
) {
5050
_.defer(() => {
5151
// Build Parallax on elements with the correct class
52+
const parallaxSpeed = Number.parseFloat(this.parent.dataStore.get("parallax_speed") as string);
5253
jarallax(
5354
this.element,
5455
{
@@ -58,7 +59,7 @@ export default class Preview extends PreviewCollection {
5859
(this.parent.dataStore.get("background_repeat") as "repeat" | "no-repeat") || "no-repeat"
5960
),
6061
imgSize: this.parent.dataStore.get("background_size") as string || "cover",
61-
speed: Number.parseFloat(this.parent.dataStore.get("parallax_speed") as string) || 0.5,
62+
speed: !isNaN(parallaxSpeed) ? parallaxSpeed : 0.5,
6263
},
6364
);
6465

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ define([
99
'use strict';
1010

1111
return function (config, element) {
12-
var $element = $(element);
12+
var $element = $(element),
13+
parallaxSpeed = null;
1314

1415
if ($element.data('appearance') === 'contained') {
1516
$element = $(element).find('[data-element="inner"]');
@@ -22,11 +23,13 @@ define([
2223
$element.addClass('jarallax');
2324
$element.attr('data-jarallax', '');
2425

26+
parallaxSpeed = parseFloat($element.data('parallaxSpeed'));
27+
2528
window.jarallax($element[0], {
2629
imgPosition: $element[0].style.backgroundPosition || '50% 50%',
2730
imgRepeat: $element[0].style.backgroundRepeat || 'no-repeat',
2831
imgSize: $element[0].style.backgroundSize || 'cover',
29-
speed: parseFloat($element.data('parallaxSpeed')) || 0.5
32+
speed: !isNaN(parallaxSpeed) ? parallaxSpeed : 0.5
3033
});
3134
};
3235
});

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/banner/_default.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
@media only screen and (max-width: @screen__m) {
6868
.pagebuilder-banner-wrapper {
69+
background-attachment: scroll !important;
70+
6971
.pagebuilder-overlay:not(.pagebuilder-poster-overlay) {
7072
max-width: none;
7173
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/column/_default.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@
1111
box-sizing: border-box;
1212
}
1313

14+
//
15+
// Responsive Classes
16+
// _____________________________________________
17+
1418
@media only screen and (max-width: @screen__m) {
1519
.pagebuilder-column {
20+
background-attachment: scroll !important;
1621
flex-basis: 100%;
1722
}
1823
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_contained.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@
1717
box-sizing: border-box;
1818
}
1919
}
20+
21+
//
22+
// Responsive Classes
23+
// _____________________________________________
24+
25+
@media only screen and (max-width: @screen__m) {
26+
[data-role='row'][data-appearance='contained'] {
27+
[data-element='inner'] {
28+
background-attachment: scroll !important;
29+
}
30+
}
31+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_full-bleed.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@
1010
[data-role='row'][data-appearance='full-bleed'] {
1111
box-sizing: border-box;
1212
}
13+
14+
//
15+
// Responsive Classes
16+
// _____________________________________________
17+
18+
@media only screen and (max-width: @screen__m) {
19+
[data-role='row'][data-appearance='full-bleed'] {
20+
background-attachment: scroll !important;
21+
}
22+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/row/_full-width.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@
1818
width: 100%;
1919
}
2020
}
21+
22+
//
23+
// Responsive Classes
24+
// _____________________________________________
25+
26+
@media only screen and (max-width: @screen__m) {
27+
[data-role='row'][data-appearance='full-width'] {
28+
background-attachment: scroll !important;
29+
}
30+
}

app/code/Magento/PageBuilder/view/frontend/web/css/source/content-type/tabs/_default.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,13 @@ div[data-role='tabs'] {
102102
}
103103
}
104104
}
105+
106+
//
107+
// Responsive Classes
108+
// _____________________________________________
109+
110+
@media only screen and (max-width: @screen__m) {
111+
[data-role='tab-item'] {
112+
background-attachment: scroll !important;
113+
}
114+
}

0 commit comments

Comments
 (0)