File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed
app/code/Magento/PageBuilder/view/frontend
web/js/content-type/buttons/appearance/inline Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 55
55
</item >
56
56
</item >
57
57
</item >
58
+ <item name =" buttons" xsi : type =" array" >
59
+ <item name =" default" xsi : type =" array" >
60
+ <item name =" component" xsi : type =" string" >Magento_PageBuilder/js/content-type/buttons/appearance/inline/widget</item >
61
+ </item >
62
+ </item >
58
63
</argument >
59
64
</arguments >
60
65
</block >
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+ define ( [
6
+ 'jquery'
7
+ ] , function ( $ ) {
8
+ 'use strict' ;
9
+
10
+ /**
11
+ * Equalize the width of a list of button-item components
12
+ *
13
+ * @param {JQuerySerializeArrayElement } buttonList
14
+ */
15
+ var equalizeButtonWidth = function ( buttonList ) {
16
+ var buttonMinWidth = 0 ;
17
+
18
+ buttonList . each ( function ( ) {
19
+ var buttonWidth = this . querySelector ( '[data-element="link"]' ) . offsetWidth ;
20
+
21
+ if ( buttonWidth > buttonMinWidth ) {
22
+ buttonMinWidth = buttonWidth ;
23
+ }
24
+ } ) ;
25
+ buttonList . each ( function ( ) {
26
+ this . querySelector ( '[data-element="link"]' ) . style . width = buttonMinWidth + 'px' ;
27
+ } ) ;
28
+ } ;
29
+
30
+ return function ( config , element ) {
31
+ var $element = $ ( element ) ;
32
+
33
+ if ( $element . attr ( 'data-same-width' ) === '1' ) {
34
+ equalizeButtonWidth ( $element . children ( ) ) ;
35
+ }
36
+ } ;
37
+ } ) ;
You can’t perform that action at this time.
0 commit comments