|
20 | 20 | * Text tools |
21 | 21 | */ |
22 | 22 | var TextControl = wp.components.TextControl; |
| 23 | + var PanelBody = wp.components.PanelBody; |
23 | 24 |
|
24 | 25 | /** |
25 | 26 | * The sidebar controls I think? |
|
121 | 122 | onChange: ( value ) => { props.setAttributes( { src: value } ); }, |
122 | 123 | } ) |
123 | 124 | ), |
124 | | - /* |
125 | | - * InspectorControls lets you add controls to the Block sidebar. In this case, |
126 | | - * we're adding a TextControl, which lets us edit the 'foo' attribute (which |
127 | | - * we defined in the PHP). The onChange property is a little bit of magic to tell |
128 | | - * the block editor to update the value of our 'foo' property, and to re-render |
129 | | - * the block. |
130 | | - */ |
131 | 125 | el( InspectorControls, {}, |
132 | | - el( TextControl, { |
133 | | - label: __( 'Pym.js Child URL' ), |
134 | | - value: props.attributes.src, |
135 | | - placeholder: __( 'What is the URL of your Pym.js child page?' ), |
136 | | - onChange: ( value ) => { props.setAttributes( { src: value } ); }, |
137 | | - } ), |
| 126 | + el( |
| 127 | + PanelBody, // inserting a PanelBody here for the presentational classes, so that it matches the display of InspectorAdvancedControls children |
| 128 | + { |
| 129 | + initialOpen: true, |
| 130 | + }, |
| 131 | + el( TextControl, { |
| 132 | + label: __( 'Pym.js Child URL' ), |
| 133 | + value: props.attributes.src, |
| 134 | + placeholder: __( 'What is the URL of your Pym.js child page?' ), |
| 135 | + onChange: ( value ) => { props.setAttributes( { src: value } ); }, |
| 136 | + } ) |
| 137 | + ) |
138 | 138 | ), |
139 | 139 | el( InspectorAdvancedControls, {}, |
140 | 140 | el( TextControl, { |
|
0 commit comments