Index: src/wp-includes/js/mce-view.js
===================================================================
--- src/wp-includes/js/mce-view.js	(revision 29194)
+++ src/wp-includes/js/mce-view.js	(working copy)
@@ -47,8 +47,6 @@
 				'</div>';
 		},
 		render: function() {
-			var html = this.getHtml() || this.loadingPlaceholder();
-
 			this.setContent(
 				'<p class="wpview-selection-before">\u00a0</p>' +
 				'<div class="wpview-body" contenteditable="false">' +
@@ -57,84 +55,79 @@
 						'<div class="dashicons dashicons-no-alt remove"></div>' +
 					'</div>' +
 					'<div class="wpview-content wpview-type-' + this.type + '">' +
-						html +
+						( this.getHtml() || this.loadingPlaceholder() ) +
 					'</div>' +
 					( this.overlay ? '<div class="wpview-overlay"></div>' : '' ) +
 				'</div>' +
 				'<p class="wpview-selection-after">\u00a0</p>',
-				function( self, editor, node ) {
-					$( self ).trigger( 'ready', [ editor, node ] );
-				},
 				'wrap'
 			);
+
+			$( this ).trigger( 'ready' );
 		},
 		unbind: function() {},
-		getNodes: function( callback ) {
-			var nodes = [];
+		getEditors: function( callback ) {
+			var editors = [];
 
 			_.each( tinymce.editors, function( editor ) {
 				if ( editor.plugins.wpview ) {
-					$( editor.getBody() )
-					.find( '[data-wpview-text="' + this.encodedText + '"]' )
-					.each( function ( i, node ) {
-						if ( callback ) {
-							callback( editor, node );
-						}
+					if ( callback ) {
+						callback( editor );
+					}
 
-						nodes.push( node );
-					} );
+					editors.push( editor );
 				}
 			}, this );
 
-			return nodes;
+			return editors;
 		},
-		setContent: function( html, callback, option ) {
-			var self = this;
+		getNodes: function( callback ) {
+			var nodes = [],
+				self = this;
 
-			this.getNodes( function ( editor, element ) {
-				var contentWrap = $( element ).find( '.wpview-content' ),
-					wrap = element;
+			this.getEditors( function( editor ) {
+				$( editor.getBody() )
+				.find( '[data-wpview-text="' + self.encodedText + '"]' )
+				.each( function ( i, node ) {
+					if ( callback ) {
+						callback( editor, node, $( node ).find( '.wpview-content' ).get( 0 ) );
+					}
 
-				if ( contentWrap.length && option !== 'wrap' ) {
-					element = contentWrap = contentWrap[0];
-				}
+					nodes.push( node );
+				} );
+			} );
 
-				if ( _.isString( html ) ) {
-					if ( option === 'replace' ) {
-						element = editor.dom.replace( editor.dom.createFragment( html ), wrap );
-					} else {
-						editor.dom.setHTML( element, html );
-					}
-				} else {
-					if ( option === 'replace' ) {
-						element = editor.dom.replace( html, wrap );
-					} else {
-						$( element ).empty().append( html );
-					}
+			return nodes;
+		},
+		setContent: function( html, option ) {
+			this.getNodes( function ( editor, node, content ) {
+				var el = ( option === 'wrap' || option === 'replace' ) ? node : content,
+					insert = html;
+
+				if ( _.isString( insert ) ) {
+					insert = editor.dom.createFragment( insert );
 				}
 
-				if ( _.isFunction( callback ) ) {
-					callback( self, editor, $( element ).find( '.wpview-content' )[0] );
+				if ( option === 'replace' ) {
+					editor.dom.replace( insert, el );
+				} else {
+					el.innerHTML = '';
+					el.appendChild( insert );
 				}
 			} );
 		},
-
 		/* jshint scripturl: true */
-		createIframe: function ( content ) {
+		setIframes: function ( html ) {
 			var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
 
-			if ( content.indexOf( '<script' ) !== -1 ) {
-				this.getNodes( function ( editor, node ) {
+			if ( html.indexOf( '<script' ) !== -1 ) {
+				this.getNodes( function ( editor, node, content ) {
 					var dom = editor.dom,
 						iframe, iframeDoc, i, resize;
 
-					node = $( node ).find( '.wpview-content' )[0];
-					if ( ! node ) {
-						return;
-					}
-					node.innerHTML = '';
+					content.innerHTML = '';
 
-					iframe = dom.add( node, 'iframe', {
+					iframe = dom.add( content, 'iframe', {
 						src: tinymce.Env.ie ? 'javascript:""' : '',
 						frameBorder: '0',
 						allowTransparency: 'true',
@@ -155,7 +148,7 @@
 								'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' +
 							'</head>' +
 							'<body data-context="iframe-sandbox" style="padding: 0; margin: 0;" class="' + editor.getBody().className + '">' +
-								content +
+								html +
 							'</body>' +
 						'</html>'
 					);
@@ -182,10 +175,9 @@
 					}
 				});
 			} else {
-				this.setContent( content );
+				this.setContent( html );
 			}
 		},
-
 		setError: function( message, dashicon ) {
 			this.setContent(
 				'<div class="wpview-error">' +
@@ -507,28 +499,30 @@
 			action: 'parse-media-shortcode',
 
 			initialize: function( options ) {
+				var self = this;
+
 				this.shortcode = options.shortcode;
-				this.fetching = false;
 
-				_.bindAll( this, 'createIframe', 'setNode', 'fetch', 'pausePlayers' );
-				$( this ).on( 'ready', this.setNode );
+				_.bindAll( this, 'setIframes', 'setNodes', 'fetch', 'pausePlayers' );
+				$( this ).on( 'ready', this.setNodes );
 
 				$( document ).on( 'media:edit', this.pausePlayers );
-			},
 
-			setNode: function ( event, editor ) {
-				editor.on( 'hide', this.pausePlayers );
+				this.fetch();
+
+				this.getEditors( function( editor ) {
+					editor.on( 'hide', self.pausePlayers );
+				});
+			},
 
+			setNodes: function () {
 				if ( this.parsed ) {
-					this.createIframe( this.parsed );
-				} else if ( ! this.fetching ) {
-					this.fetch();
+					this.setIframes( this.parsed );
 				}
 			},
 
 			fetch: function () {
 				var self = this;
-				this.fetching = true;
 
 				wp.ajax.send( this.action, {
 					data: {
@@ -537,13 +531,10 @@
 						shortcode: this.shortcode.string()
 					}
 				} )
-				.always( function() {
-					self.fetching = false;
-				} )
 				.done( function( response ) {
 					if ( response ) {
 						self.parsed = response;
-						self.createIframe( response );
+						self.setIframes( response );
 					}
 				} )
 				.fail( function( response ) {
@@ -553,7 +544,7 @@
 
 							self.setError( response.message, 'admin-media' );
 						} else {
-							self.setContent( '<p>' + self.original + '</p>', null, 'replace' );
+							self.setContent( '<p>' + self.original + '</p>', 'replace' );
 						}
 					} else if ( response && response.statusText ) {
 						self.setError( response.statusText, 'admin-media' );
@@ -561,21 +552,9 @@
 				} );
 			},
 
-			/**
-			 * Return parsed response
-			 *
-			 * @returns {string}
-			 */
-			getHtml: function() {
-				if ( ! this.parsed ) {
-					return ' ';
-				}
-				return this.parsed;
-			},
-
 			pausePlayers: function() {
-				this.getNodes( function( editor, node ) {
-					var p, win = $( 'iframe', node ).get(0).contentWindow;
+				this.getNodes( function( editor, node, content ) {
+					var p, win = $( 'iframe', content ).get(0).contentWindow;
 
 					if ( win && win.mejs ) {
 						for ( p in win.mejs.players ) {
@@ -586,8 +565,8 @@
 			},
 
 			unsetPlayers: function() {
-				this.getNodes( function( editor, node ) {
-					var p, win = $( 'iframe', node ).get(0).contentWindow;
+				this.getNodes( function( editor, node, content ) {
+					var p, win = $( 'iframe', content ).get(0).contentWindow;
 
 					if ( win && win.mejs ) {
 						for ( p in win.mejs.players ) {
@@ -679,8 +658,6 @@
 			action: 'parse-embed',
 			initialize: function( options ) {
 				this.content = options.content;
-				this.fetching = false;
-				this.parsed = false;
 				this.original = options.url || options.shortcode.string();
 
 				if ( options.url ) {
@@ -691,20 +668,10 @@
 					this.shortcode = options.shortcode;
 				}
 
-				_.bindAll( this, 'createIframe', 'setNode', 'fetch' );
-				$( this ).on( 'ready', this.setNode );
-			},
+				_.bindAll( this, 'setIframes', 'setNodes', 'fetch' );
+				$( this ).on( 'ready', this.setNodes );
 
-			/**
-			 * Return parsed response
-			 *
-			 * @returns {string}
-			 */
-			getHtml: function() {
-				if ( ! this.parsed ) {
-					return '';
-				}
-				return this.parsed;
+				this.fetch();
 			}
 		} ),
 		edit: function( node ) {
