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:
Andrew Ozz 2014-02-25 21:02:22 +00:00
parent 46ee6fbc51
commit 5e8787d0de
3 changed files with 9 additions and 2 deletions

View File

@ -2768,6 +2768,10 @@
}
this.controller.on( 'activate', this.refresh, this );
this.controller.on( 'detach', function() {
this.$browser.remove();
}, this );
},
refresh: function() {

View File

@ -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();

View File

@ -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