Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Height control in Cover if we only selected an image #17371

Merged
merged 3 commits into from
Sep 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 34 additions & 30 deletions packages/block-library/src/cover/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,6 @@ class CoverEdit extends Component {
onChange={ ( value ) => setAttributes( { focalPoint: value } ) }
/>
) }
<CoverHeightInput
value={ temporaryMinHeight || minHeight }
onChange={
( value ) => {
setAttributes( {
minHeight: value,
} );
}
}
/>
<PanelRow>
<Button
isDefault
Expand All @@ -359,27 +349,41 @@ class CoverEdit extends Component {
</PanelBody>
) }
{ ( url || overlayColor.color ) && (
<PanelColorSettings
title={ __( 'Overlay' ) }
initialOpen={ true }
colorSettings={ [ {
value: overlayColor.color,
onChange: setOverlayColor,
label: __( 'Overlay Color' ),
} ] }
>
{ !! url && (
<RangeControl
label={ __( 'Background Opacity' ) }
value={ dimRatio }
onChange={ setDimRatio }
min={ 0 }
max={ 100 }
step={ 10 }
required
<>
<PanelBody title={ __( 'Dimensions' ) }>
<CoverHeightInput
value={ temporaryMinHeight || minHeight }
onChange={
( value ) => {
setAttributes( {
minHeight: value,
} );
}
}
/>
) }
</PanelColorSettings>
</PanelBody>
<PanelColorSettings
title={ __( 'Overlay' ) }
initialOpen={ true }
colorSettings={ [ {
value: overlayColor.color,
onChange: setOverlayColor,
label: __( 'Overlay Color' ),
} ] }
>
{ !! url && (
<RangeControl
label={ __( 'Background Opacity' ) }
value={ dimRatio }
onChange={ setDimRatio }
min={ 0 }
max={ 100 }
step={ 10 }
required
/>
) }
</PanelColorSettings>
</>
) }
</InspectorControls>
</>
Expand Down