mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Cleanup audio/video shortcodes in the media modal:
* On the controller's `update`, `replace`, and `close` events, call `detach()` on the frame * Cleanup the HTML ouput of the Underscore templates. * Move some logic from the Underscore template to the `VideoDetails` view class. See #27016. git-svn-id: https://develop.svn.wordpress.org/trunk@27440 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -94,16 +94,24 @@ tinymce.PluginManager.add('wpgallery', function( editor ) {
|
||||
});
|
||||
} else if ( editor.dom.hasClass( node, 'wp-video' ) ) {
|
||||
frame = wp.media.video.edit( data );
|
||||
frame.on( 'close', function () {
|
||||
frame.detach();
|
||||
} );
|
||||
frame.state( 'video-details' ).on( 'update replace', function ( selection ) {
|
||||
var shortcode = wp.media.video.shortcode( selection );
|
||||
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
||||
frame.detach();
|
||||
} );
|
||||
frame.open();
|
||||
} else if ( editor.dom.hasClass( node, 'wp-audio' ) ) {
|
||||
frame = wp.media.audio.edit( data );
|
||||
frame.on( 'close', function () {
|
||||
frame.detach();
|
||||
} );
|
||||
frame.state( 'audio-details' ).on( 'update replace', function ( selection ) {
|
||||
var shortcode = wp.media.audio.shortcode( selection );
|
||||
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
||||
frame.detach();
|
||||
} );
|
||||
frame.open();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user