Make WordPress Core

Ticket #48028: 48028.2.patch

File 48028.2.patch, 1.1 KB (added by antpb, 7 years ago)

Fixes edit state to open in modal for image block, featured frame. Work in progress. only for discussion.

  • src/js/media/views/frame/select.js

     
    5858                };
    5959        },
    6060
     61        editImageContent: function() {
     62                var image = this.state().get('image'),
     63                        view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
     64
     65                this.content.set( view );
     66
     67                // after creating the wrapper view, load the actual editor via an ajax call
     68                view.loadEditor();
     69        },
     70
    6171        /**
    6272         * Create the default states on the frame.
    6373         */
     
    7686                                multiple:  options.multiple,
    7787                                title:     options.title,
    7888                                priority:  20
    79                         })
     89                        }),
     90                        new wp.media.controller.EditImage( { model: options.editImage, } ),
    8091                ]);
    8192        },
    8293
     
    91102                this.on( 'content:create:browse', this.browseContent, this );
    92103                this.on( 'content:render:upload', this.uploadContent, this );
    93104                this.on( 'toolbar:create:select', this.createSelectToolbar, this );
     105                this.on( 'content:render:edit-image', this.editImageContent, this );
    94106        },
    95107
    96108        /**