Skip to content

Commit

Permalink
Paragraph Block: Move the block alignment to the inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Aug 22, 2017
1 parent ac911ae commit 53dfb42
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions blocks/library/paragraph/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ registerBlockType( 'core/paragraph', {

getEditWrapperProps( attributes ) {
const { width } = attributes;
if ( 'wide' === width || 'full' === width ) {
if ( [ 'wide', 'full', 'left', 'right' ].indexOf( width ) !== -1 ) {
return { 'data-align': width };
}
},
Expand All @@ -96,11 +96,6 @@ registerBlockType( 'core/paragraph', {
return [
focus && (
<BlockControls key="controls">
<BlockAlignmentToolbar
value={ width }
onChange={ ( nextWidth ) => setAttributes( { width: nextWidth } ) }
controls={ [ 'wide', 'full' ] }
/>
<AlignmentToolbar
value={ align }
onChange={ ( nextAlign ) => {
Expand Down Expand Up @@ -140,6 +135,11 @@ registerBlockType( 'core/paragraph', {
value={ textColor }
onChange={ ( colorValue ) => setAttributes( { textColor: colorValue.hex } ) }
/>
<h3>{ __( 'Block Alignment' ) }</h3>
<BlockAlignmentToolbar
value={ width }
onChange={ ( nextWidth ) => setAttributes( { width: nextWidth } ) }
/>
</InspectorControls>
),
<Editable
Expand Down

0 comments on commit 53dfb42

Please sign in to comment.