Skip to content

Commit 3de3cf4

Browse files
authored
Merge pull request #74 from INN/72-visual-fixes
Wrap the always-visible textControl in a PanelBody so that it has the correct padding
2 parents ee341bd + 5ec62ae commit 3de3cf4

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

js/block.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* Text tools
2121
*/
2222
var TextControl = wp.components.TextControl;
23+
var PanelBody = wp.components.PanelBody;
2324

2425
/**
2526
* The sidebar controls I think?
@@ -121,20 +122,19 @@
121122
onChange: ( value ) => { props.setAttributes( { src: value } ); },
122123
} )
123124
),
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-
*/
131125
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+
)
138138
),
139139
el( InspectorAdvancedControls, {},
140140
el( TextControl, {

readme.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://inn.org/donate
44
Tags: shortcode, iframe, javascript, embeds, responsive, pym, NPR
55
Requires at least: 3.0.1
66
Requires PHP: 5.3
7-
Tested up to: 5.3.2
7+
Tested up to: 5.4
88
Stable tag: 1.3.2.3
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -50,6 +50,10 @@ Mobile view of the WordPress post with the NPR embed using Pym.js Shortcode:
5050

5151
== Changelog ==
5252

53+
= [next] =
54+
55+
- Fixes a presentational error in the Pym.js Embeds Block's block inspector control within the editor. PR [#74](https://github.com/INN/pym-shortcode/pull/74) for issue [#72](https://github.com/INN/pym-shortcode/issues/72).
56+
5357
= 1.3.2.3 =
5458

5559
New features:

0 commit comments

Comments
 (0)