File tree Expand file tree Collapse file tree 10 files changed +67
-4
lines changed
app/code/Magento/PageBuilder
base/web/js/content-type/row/appearance/default
frontend/web/css/source/content-type Expand file tree Collapse file tree 10 files changed +67
-4
lines changed Original file line number Diff line number Diff line change 3235
3235
<actionGroup ref =" switchToPageBuilderStage" stepKey =" switchToPageBuilderStage" />
3236
3236
</before >
3237
3237
<after >
3238
+ <resizeWindow width =" 1280" height =" 1024" stepKey =" resizeWindowToDesktop" />
3238
3239
<actionGroup ref =" navigateToMediaGallery" stepKey =" navigateToMediaGallery" />
3239
3240
<actionGroup ref =" NavigateToMediaFolderActionGroup" stepKey =" NavigateToFolder" >
3240
3241
<argument name =" FolderName" value =" {{PageBuilderBackgroundImage_JPG.path}}" />
3311
3312
<argument name =" backgroundImage" value =" PageBuilderBackgroundImage_JPG" />
3312
3313
<argument name =" pageNamePrefix" value =" banner" />
3313
3314
</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 >
3314
3323
</test >
3315
3324
</tests >
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export default class Preview extends PreviewCollection {
49
49
) {
50
50
_ . defer ( ( ) => {
51
51
// Build Parallax on elements with the correct class
52
+ const parallaxSpeed = Number . parseFloat ( this . parent . dataStore . get ( "parallax_speed" ) as string ) ;
52
53
jarallax (
53
54
this . element ,
54
55
{
@@ -58,7 +59,7 @@ export default class Preview extends PreviewCollection {
58
59
( this . parent . dataStore . get ( "background_repeat" ) as "repeat" | "no-repeat" ) || "no-repeat"
59
60
) ,
60
61
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 ,
62
63
} ,
63
64
) ;
64
65
Original file line number Diff line number Diff line change 9
9
'use strict' ;
10
10
11
11
return function ( config , element ) {
12
- var $element = $ ( element ) ;
12
+ var $element = $ ( element ) ,
13
+ parallaxSpeed = null ;
13
14
14
15
if ( $element . data ( 'appearance' ) === 'contained' ) {
15
16
$element = $ ( element ) . find ( '[data-element="inner"]' ) ;
@@ -22,11 +23,13 @@ define([
22
23
$element . addClass ( 'jarallax' ) ;
23
24
$element . attr ( 'data-jarallax' , '' ) ;
24
25
26
+ parallaxSpeed = parseFloat ( $element . data ( 'parallaxSpeed' ) ) ;
27
+
25
28
window . jarallax ( $element [ 0 ] , {
26
29
imgPosition : $element [ 0 ] . style . backgroundPosition || '50% 50%' ,
27
30
imgRepeat : $element [ 0 ] . style . backgroundRepeat || 'no-repeat' ,
28
31
imgSize : $element [ 0 ] . style . backgroundSize || 'cover' ,
29
- speed : parseFloat ( $element . data ( ' parallaxSpeed' ) ) || 0.5
32
+ speed : ! isNaN ( parallaxSpeed ) ? parallaxSpeed : 0.5
30
33
} ) ;
31
34
} ;
32
35
} ) ;
Original file line number Diff line number Diff line change 66
66
67
67
@media only screen and (max-width : @screen__m ) {
68
68
.pagebuilder-banner-wrapper {
69
+ background-attachment : scroll !important ;
70
+
69
71
.pagebuilder-overlay :not (.pagebuilder-poster-overlay ) {
70
72
max-width : none ;
71
73
}
Original file line number Diff line number Diff line change 11
11
box-sizing : border-box ;
12
12
}
13
13
14
+ //
15
+ // Responsive Classes
16
+ // _____________________________________________
17
+
14
18
@media only screen and (max-width : @screen__m ) {
15
19
.pagebuilder-column {
20
+ background-attachment : scroll !important ;
16
21
flex-basis : 100% ;
17
22
}
18
23
}
Original file line number Diff line number Diff line change 17
17
box-sizing : border-box ;
18
18
}
19
19
}
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
+ }
Original file line number Diff line number Diff line change 10
10
[data- role= ' row' ][data- appearance= ' full-bleed' ] {
11
11
box-sizing : border-box ;
12
12
}
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
+ }
Original file line number Diff line number Diff line change 18
18
width : 100% ;
19
19
}
20
20
}
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
+ }
Original file line number Diff line number Diff line change @@ -102,3 +102,13 @@ div[data-role='tabs'] {
102
102
}
103
103
}
104
104
}
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
+ }
You can’t perform that action at this time.
0 commit comments