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

Take Two: Update the gallery block so it limits the columns to the the current number of images #13488

Merged
merged 1 commit into from Jan 25, 2019

Conversation

Projects
None yet
3 participants
@brentswisher
Copy link
Contributor

brentswisher commented Jan 24, 2019

This is a redo of PR #13443 as I rebased and royally messed my branch and that PR up, sorry @jorgefilipecosta

Description

Update the columns attribute when the onSelectImages function fires so that if images are removed via the media modal, the columns will be updated. This way columns won't be higher than the new number of images.

Previously this worked if removing images via the X in the editor, but not if you removed them via the media modal

Fixes #13423

How has this been tested?

Add a gallery with multiple images, set the columns to be the maximum allowed. Edit the gallery via the media modal and remove images, when you save the media modal, the columns should be adjusted to match the new number of photos.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
Update the columns attribute in onSelectImages so that if images are …
…removed via the media modal, the columns can't be higher than the new number of images
@jorgefilipecosta
Copy link
Member

jorgefilipecosta left a comment

LGTM 👍 Thank you for iterating on this changes @brentswisher!

@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Jan 25, 2019

@gziolo gziolo merged commit 033e664 into WordPress:master Jan 25, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

daniloercoli added a commit that referenced this pull request Jan 26, 2019

Merge branch 'master' of https://github.com/WordPress/gutenberg into …
…rnmobile/372-enter-key-detection-to-title

* 'master' of https://github.com/WordPress/gutenberg: (29 commits)
  Update for RangeControl documentation (#12564)
  Plugin: Deprecate gutenberg_load_list_reusable_blocks (#13456)
  Update the columns attribute in onSelectImages so that if images are removed via the media modal, the columns can't be higher than the new number of images (#13488)
  Replace the fullscreen "exit" icon with a back arrow (#13403)
  Include :visited links in button color (#12183)
  Amazon Kindle block (#13510)
  Plugin: Deprecate gutenberg_prepare_blocks_for_js (#13457)
  Add watcher on Linux: change fs to node-watch (#13448)
  Plugin: Deprecate `gutenberg` theme support (#13458)
  Datepicker: Add inValidDay support (#12962)
  Block Switcher: Render disabled button even if multi-selection (#13431)
  Plugin: Deprecate gutenberg_register_post_types (#13468)
  Plugin: Deprecate register_tinymce_scripts (#13466)
  Set minimum of words for RSS excerpt (#13502)
  Plugin: Deprecate gutenberg_get_block_categories (#13454)
  Plugin: Deprecate gutenberg_content_block_version (#13469)
  API Fetch: Expose nonce on created middleware function (#13451)
  Plugin: Remove list screens integrations (#13459)
  Plugin: Remove core-defined block detection functions (#13467)
  Spec Parser: Move generated spec parser to package (#13493)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment