File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
app/code/Magento/PageBuilder/view/adminhtml/web
ts/js/content-type/buttons Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import PreviewCollection from "../preview-collection";
24
24
*/
25
25
export default class Preview extends PreviewCollection {
26
26
public isLiveEditing : KnockoutObservable < boolean > = ko . observable ( false ) ;
27
+ public currentMaxWidth : KnockoutObservable < number > = ko . observable ( 0 ) ;
27
28
/**
28
29
* Keeps track of number of button item to disable sortable if there is only 1.
29
30
*/
@@ -242,12 +243,16 @@ export default class Preview extends PreviewCollection {
242
243
if ( buttonItems . length > 0 ) {
243
244
buttonItems . css ( "min-width" , "" ) ;
244
245
const currentLargestButton = this . findLargestButton ( buttonItems ) ;
245
- buttonResizeValue = currentLargestButton . outerWidth ( ) ;
246
+ const currentLargestButtonWidth = currentLargestButton . outerWidth ( ) ;
247
+ if ( currentLargestButtonWidth !== 0 ) {
248
+ buttonResizeValue = currentLargestButtonWidth ;
249
+ this . currentMaxWidth ( currentLargestButtonWidth ) ;
250
+ } else {
251
+ buttonResizeValue = this . currentMaxWidth ( ) ;
252
+ }
246
253
}
247
254
}
248
- if ( buttonResizeValue > 0 ) {
249
- buttonItems . css ( "min-width" , buttonResizeValue ) ;
250
- }
255
+ buttonItems . css ( "min-width" , buttonResizeValue ) ;
251
256
}
252
257
}
253
258
You can’t perform that action at this time.
0 commit comments