Commit ad7152ab authored by Andrew Ozz's avatar Andrew Ozz
Browse files

When closing the various "edit" media modals, remove the related views...

When closing the various "edit" media modals, remove the related views elements from the DOM. Props gcorne, fixes #27204.
Built from https://develop.svn.wordpress.org/trunk@27276


git-svn-id: https://core.svn.wordpress.org/trunk@27132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 0a4b8f22
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2768,6 +2768,10 @@
			}

			this.controller.on( 'activate', this.refresh, this );

			this.controller.on( 'detach', function() {
				this.$browser.remove();
			}, this );
		},

		refresh: function() {
+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -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();
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+3 −0
Original line number Diff line number Diff line
@@ -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