File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed
app/code/Magento/PageBuilder/view/adminhtml/web Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change 327
327
height : 40px ;
328
328
opacity : 0 ;
329
329
position : absolute ;
330
- right : 0 ;
330
+ right : 50 % ;
331
331
text-align : center ;
332
332
top : 0 ;
333
- transform : translate (0 , -50% );
333
+ transform : translate (50 % , -50% );
334
334
-moz-transition : opacity 200ms , visibility 200ms ;
335
335
-o-transition : opacity 200ms , visibility 200ms ;
336
336
-webkit-transition : opacity 200ms , visibility 200ms ;
337
337
transition : opacity 200ms , visibility 200ms ;
338
338
visibility : hidden ;
339
339
z-index : 105 ;
340
340
341
- & .pagebuilder-options-middle {
342
- right : 50 % ;
343
- transform : translate (50 % , -50% );
341
+ & .pagebuilder-options-right {
342
+ right : 0 ;
343
+ transform : translate (0 , -50% );
344
344
}
345
345
346
346
& .pagebuilder-options-visible {
Original file line number Diff line number Diff line change @@ -197,8 +197,10 @@ export default class Preview {
197
197
const middleOfPreview = currentTarget . getBoundingClientRect ( ) . left + currentTarget . offsetWidth / 2 ;
198
198
199
199
// if there are space for moving options menu to the middle
200
- if ( window . innerWidth - middleOfPreview > optionsMenu . width ( ) / 2 ) {
201
- optionsMenu . parent ( ) . addClass ( "pagebuilder-options-middle" ) ;
200
+ if ( ! ( window . innerWidth - middleOfPreview > optionsMenu . width ( ) / 2 ) ) {
201
+ optionsMenu . parent ( ) . addClass ( "pagebuilder-options-right" ) ;
202
+ } else {
203
+ optionsMenu . parent ( ) . removeClass ( "pagebuilder-options-right" ) ;
202
204
}
203
205
204
206
optionsMenu . parent ( ) . addClass ( "pagebuilder-options-visible" ) ;
@@ -229,9 +231,6 @@ export default class Preview {
229
231
}
230
232
231
233
optionsMenu . parent ( ) . removeClass ( "pagebuilder-options-visible" ) ;
232
- _ . delay ( ( ) => {
233
- optionsMenu . parent ( ) . removeClass ( "pagebuilder-options-middle" ) ;
234
- } , 200 ) ;
235
234
$ ( currentTarget ) . removeClass ( "pagebuilder-content-type-active" ) ;
236
235
}
237
236
} , 100 ) ; // 100 ms delay to allow for users hovering over other elements
You can’t perform that action at this time.
0 commit comments