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

Gallery: Update media frame state management #2488

Merged
merged 2 commits into from
Apr 24, 2018

Commits on Apr 23, 2018

  1. Gallery: Properly set editing option for the media frame; Improve loa…

    …ding of media frame when editing a gallery; Editing a gallery opens media frame in gallery-edit state
    
    This sets the editing option based on the values property of our component.
    
    Previously, we were replacing the media frame state right before opening
    the modal, but after views like the menu were created. This caused a few
    bugs, like the cancel button moving back to the initial "create gallery"
    state and some labels being incorrect. This creates a selection from any
    existing IDs and passes it to the frame before it is created to avoid
    these issues.
    
    Additionally, this updates the method for getting a collection of
    attachments using `wp.media.query` so we can fetch all of the attachment
    models in one request, rather than relying on seperate requests for each
    attachment in the gallery.
    
    When opening the `wp.media` modal to modify an existing gallery, the
    frame should be opened in the `gallery-edit` state, rather than the
    `gallery` state used when selecting images for a new gallery.
    joemcgill authored and jorgefilipecosta committed Apr 23, 2018
    Configuration menu
    Copy the full SHA
    d5aa7aa View commit details
    Browse the repository at this point in the history
  2. Corrected bug where single media selection was not working as expecte…

    …d; Corrected bug where if gallery was empty all media content was loaded.
    jorgefilipecosta committed Apr 23, 2018
    Configuration menu
    Copy the full SHA
    4586353 View commit details
    Browse the repository at this point in the history