mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 07:37:44 +02:00
Media: Adds Edit Image controller to Media Library select
frame.
This adds the necessary state for `EditImage` views in the `select` frame and listeners for setting that view. Props fblaser, w3rkjana, afercia, antpb. See #48028. Built from https://develop.svn.wordpress.org/trunk@46461 git-svn-id: http://core.svn.wordpress.org/trunk@46259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ebd52ce048
commit
97356bbd75
@ -3322,6 +3322,16 @@ Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editImageContent: function() {
|
||||||
|
var image = this.state().get('image'),
|
||||||
|
view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
|
||||||
|
|
||||||
|
this.content.set( view );
|
||||||
|
|
||||||
|
// after creating the wrapper view, load the actual editor via an ajax call
|
||||||
|
view.loadEditor();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the default states on the frame.
|
* Create the default states on the frame.
|
||||||
*/
|
*/
|
||||||
@ -3340,7 +3350,8 @@ Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype
|
|||||||
multiple: options.multiple,
|
multiple: options.multiple,
|
||||||
title: options.title,
|
title: options.title,
|
||||||
priority: 20
|
priority: 20
|
||||||
})
|
}),
|
||||||
|
new wp.media.controller.EditImage( { model: options.editImage } )
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -3355,6 +3366,7 @@ Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype
|
|||||||
this.on( 'content:create:browse', this.browseContent, this );
|
this.on( 'content:create:browse', this.browseContent, this );
|
||||||
this.on( 'content:render:upload', this.uploadContent, this );
|
this.on( 'content:render:upload', this.uploadContent, this );
|
||||||
this.on( 'toolbar:create:select', this.createSelectToolbar, this );
|
this.on( 'toolbar:create:select', this.createSelectToolbar, this );
|
||||||
|
this.on( 'content:render:edit-image', this.editImageContent, this );
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-beta3-46460';
|
$wp_version = '5.3-beta3-46461';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user