Ticket #28195: 28195.15.patch
File 28195.15.patch, 1.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/mce-view.js
52 52 '<ins data-wpview-end="1"></ins>', 53 53 function( self, editor, node ) { 54 54 $( self ).trigger( 'ready', [ editor, node ] ); 55 } 55 }, 56 'wrap' 56 57 ); 57 58 }, 58 59 unbind: function() {}, 59 setContent: function( html, callback, replace) {60 setContent: function( html, callback, option ) { 60 61 _.each( tinymce.editors, function( editor ) { 61 62 var self = this; 62 63 if ( editor.plugins.wpview ) { … … 66 67 var contentWrap = $( element ).children( '.wpview-content' ), 67 68 wrap = element; 68 69 69 if ( contentWrap.length ) {70 if ( contentWrap.length && option !== 'wrap' ) { 70 71 element = contentWrap = contentWrap[0]; 71 72 } 72 73 73 74 if ( _.isString( html ) ) { 74 if ( replace) {75 if ( option === 'replace' ) { 75 76 element = editor.dom.replace( editor.dom.createFragment( html ), wrap ); 76 77 } else { 77 78 editor.dom.setHTML( element, html ); 78 79 } 79 80 } else { 80 if ( replace) {81 if ( option === 'replace' ) { 81 82 element = editor.dom.replace( html, wrap ); 82 83 } else { 83 84 element.appendChild( html ); … … 729 730 if ( self.type === 'embed' ) { 730 731 self.setError( self.original + ' failed to embed.', 'admin-media' ); 731 732 } else { 732 self.setContent( self.original, null, true);733 self.setContent( self.original, null, 'replace' ); 733 734 } 734 735 } else { 735 736 self.parsed = content;