Skip to content
Prev Previous commit
Adjusts PR to factor in review suggestions
  • Loading branch information
anthonyburchell committed Feb 12, 2020
commit b2b3969d6dcafb33f8f9c40f9545639ab5749287
28 changes: 16 additions & 12 deletions packages/media-utils/src/components/media-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ const getFeaturedImageMediaFrame = () => {
* @return {void}
*/
editState() {
const selection = this.state( 'featured-image' ).get( 'selection' ),
view = new wp.media.view.EditImage( {
model: selection.single(),
controller: this,
} ).render();
const selection = this.state( 'featured-image' ).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
// After bringing in the frame, load the actual editor via an ajax call.
view.loadEditor();
},

Expand Down Expand Up @@ -133,14 +135,16 @@ const getGalleryDetailsMediaFrame = () => {
* @return {void}
*/
editState() {
const selection = this.state( 'gallery' ).get( 'selection' ),
view = new wp.media.view.EditImage( {
model: selection.single(),
controller: this,
} ).render();
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
// After bringing in the frame, load the actual editor via an ajax call.
view.loadEditor();
},

Expand Down