When closing the various "edit" media modals, remove the related views elements from the DOM. Props gcorne, fixes #27204.
git-svn-id: https://develop.svn.wordpress.org/trunk@27276 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
46ee6fbc51
commit
5e8787d0de
@ -2768,6 +2768,10 @@
|
||||
}
|
||||
|
||||
this.controller.on( 'activate', this.refresh, this );
|
||||
|
||||
this.controller.on( 'detach', function() {
|
||||
this.$browser.remove();
|
||||
}, this );
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
|
@ -288,14 +288,14 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
callback = function( imageData ) {
|
||||
updateImage( img, imageData );
|
||||
editor.focus();
|
||||
frame.detach();
|
||||
};
|
||||
|
||||
frame.state('image-details').on( 'update', callback );
|
||||
frame.state('replace-image').on( 'replace', callback );
|
||||
frame.on( 'close', function() {
|
||||
editor.focus();
|
||||
// editor.selection.select( img );
|
||||
// editor.nodeChanged();
|
||||
frame.detach();
|
||||
});
|
||||
|
||||
frame.open();
|
||||
|
@ -73,6 +73,7 @@ tinymce.PluginManager.add('wpgallery', function( editor ) {
|
||||
frame.state('gallery-edit').on( 'update', function( selection ) {
|
||||
var shortcode = gallery.shortcode( selection ).string();
|
||||
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
||||
frame.detach();
|
||||
});
|
||||
} else if ( editor.dom.hasClass( node, 'wp-playlist' ) && wp.media.playlist ) {
|
||||
data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
|
||||
@ -81,6 +82,7 @@ tinymce.PluginManager.add('wpgallery', function( editor ) {
|
||||
frame.state('playlist-edit').on( 'update', function( selection ) {
|
||||
var shortcode = wp.media.playlist.shortcode( selection ).string();
|
||||
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
||||
frame.detach();
|
||||
});
|
||||
} else if ( editor.dom.hasClass( node, 'wp-video-playlist' ) && wp.media['video-playlist'] ) {
|
||||
data = window.decodeURIComponent( editor.dom.getAttrib( node, 'data-wp-media' ) );
|
||||
@ -89,6 +91,7 @@ tinymce.PluginManager.add('wpgallery', function( editor ) {
|
||||
frame.state('video-playlist-edit').on( 'update', function( selection ) {
|
||||
var shortcode = wp.media['video-playlist'].shortcode( selection ).string();
|
||||
editor.dom.setAttrib( node, 'data-wp-media', window.encodeURIComponent( shortcode ) );
|
||||
frame.detach();
|
||||
});
|
||||
} else {
|
||||
// temp
|
||||
|
Loading…
Reference in New Issue
Block a user