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

Already on GitHub? Sign in to your account

Cover Image Block: Show inspector controls when no image is selected #2506

Merged
merged 3 commits into from Aug 25, 2017

Conversation

Projects
None yet
2 participants
Collaborator

youknowriad commented Aug 23, 2017

closes #2485

When you insert a Cover Image, you'll be able to tweak its inspector controls even if you didn't select an image yet.

@youknowriad youknowriad Cover Image Block: Show inspector controls when no image is selected
6366b95

@youknowriad youknowriad added the Blocks label Aug 23, 2017

@youknowriad youknowriad self-assigned this Aug 23, 2017

@youknowriad youknowriad requested a review from jasmussen Aug 23, 2017

codecov bot commented Aug 23, 2017 edited

Codecov Report

Merging #2506 into master will increase coverage by 0.11%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2506      +/-   ##
==========================================
+ Coverage    28.7%   28.82%   +0.11%     
==========================================
  Files         167      174       +7     
  Lines        5103     5739     +636     
  Branches      849     1048     +199     
==========================================
+ Hits         1465     1654     +189     
- Misses       3086     3400     +314     
- Partials      552      685     +133
Impacted Files Coverage Δ
blocks/library/cover-image/index.js 30.43% <16.66%> (ø) ⬆️
blocks/library/audio/index.js 21.62% <0%> (-14.75%) ⬇️
utils/mediaupload.js 16.12% <0%> (-5.62%) ⬇️
blocks/library/html/index.js 19.04% <0%> (-4.03%) ⬇️
blocks/api/paste/utils.js 98.11% <0%> (-1.89%) ⬇️
blocks/editable/index.js 9.57% <0%> (-1.72%) ⬇️
editor/index.js 0% <0%> (ø) ⬆️
blocks/editable/tinymce.js 0% <0%> (ø) ⬆️
blocks/api/paste/is-inline-content.js 100% <0%> (ø) ⬆️
editor/modes/visual-editor/block.js 0% <0%> (ø) ⬆️
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d4bf0a...bd2fb5c. Read the comment docs.

blocks/library/cover-image/index.js
@@ -93,10 +100,30 @@ registerBlockType( 'core/cover-image', {
)
);
+ const inspectorControls = focus && (
@aduth

aduth Aug 23, 2017

Member

Could we consolidate this to a single variable, i.e.

const controls = focus && [
	<BlockControls key="controls" />,
	<InspectorControls key="inspector" />,
];

?

@youknowriad youknowriad Cover Image: Merge controls and inspectors into the same variable
6d041c0

aduth approved these changes Aug 24, 2017

Not related to this pull request, but the Cover Image block doesn't save particularly well when the image is not assigned, i.e. it assigns a background-image: url(undefined).

@youknowriad youknowriad Cover Image: Fix style when the image is unassigned
bd2fb5c
Collaborator

youknowriad commented Aug 25, 2017

Pushed a small fix for the style issue. Thanks Andrew

@youknowriad youknowriad merged commit ec49b3d into master Aug 25, 2017

3 checks passed

codecov/project 28.82% (+0.11%) compared to 4d4bf0a
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@youknowriad youknowriad deleted the update/cover-image-inspector branch Aug 25, 2017

@youknowriad youknowriad referenced this pull request Aug 28, 2017

Closed

'Cover Image' this term is not defined #2546

0 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment