Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions packages/media-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Fix a `TypeError` when opening the image editor for an image in an existing gallery, by removing the redundant `edit-image` handler in the gallery details frame.

### Internal

- Remove the `window.__heicUploadSupport` type declaration, following the removal of the redundant flag ([#80452](https://github.com/WordPress/gutenberg/pull/80452)).
Expand Down
20 changes: 0 additions & 20 deletions packages/media-utils/src/components/media-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,33 +173,13 @@ const getGalleryDetailsMediaFrame = () => {
);
},

/**
* Handle the edit state requirements of selected media item.
*
* @return {void}
*/
editState() {
const selection = this.state( 'gallery' ).get( 'selection' );
const view = new wp.media.view.EditImage( {
model: selection.single(),
controller: this,
} ).render();

// Set the view to the EditImage frame using the selected image.
this.content.set( view );

// After bringing in the frame, load the actual editor via an ajax call.
view.loadEditor();
},

/**
* Create the default states.
*
* @return {void}
*/
createStates: function createStates() {
this.on( 'toolbar:create:main-gallery', this.galleryToolbar, this );
this.on( 'content:render:edit-image', this.editState, this );

this.states.add( [
new wp.media.controller.Library( {
Expand Down
Loading