Make WordPress Core

Ticket #31669: 31669.15.patch

File 31669.15.patch, 2.2 KB (added by iseulde, 10 years ago)
  • src/wp-includes/js/mce-view.js

     
    322322                        this.replaceMarkers();
    323323
    324324                        if ( content ) {
    325                                 this.setContent( content, function( editor, node ) {
     325                                this.setContent( content, function( editor, node, contentNode ) {
    326326                                        $( node ).data( 'rendered', true );
    327                                         this.bindNode.call( this, editor, node );
     327                                        this.bindNode.call( this, editor, node, contentNode );
    328328                                }, force ? null : false );
    329329                        } else {
    330330                                this.setLoader();
     
    346346                 * Runs before their content is removed from the DOM.
    347347                 */
    348348                unbind: function() {
    349                         this.getNodes( function( editor, node ) {
    350                                 this.unbindNode.call( this, editor, node );
     349                        this.getNodes( function( editor, node, contentNode ) {
     350                                this.unbindNode.call( this, editor, node, contentNode );
    351351                                $( node ).trigger( 'wp-mce-view-unbind' );
    352352                        }, true );
    353353                },
     
    485485                        var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver,
    486486                                self = this;
    487487
    488                         this.getNodes( function( editor, node, content ) {
     488                        this.getNodes( function( editor, node, contentNode ) {
    489489                                var dom = editor.dom,
    490490                                        styles = '',
    491491                                        bodyClasses = editor.getBody().className || '',
     
    504504                                setTimeout( function() {
    505505                                        var iframe, iframeDoc, observer, i;
    506506
    507                                         content.innerHTML = '';
     507                                        contentNode.innerHTML = '';
    508508
    509                                         iframe = dom.add( content, 'iframe', {
     509                                        iframe = dom.add( contentNode, 'iframe', {
    510510                                                /* jshint scripturl: true */
    511511                                                src: tinymce.Env.ie ? 'javascript:""' : '',
    512512                                                frameBorder: '0',
     
    519519                                                }
    520520                                        } );
    521521
    522                                         dom.add( content, 'div', { 'class': 'wpview-overlay' } );
     522                                        dom.add( contentNode, 'div', { 'class': 'wpview-overlay' } );
    523523
    524524                                        iframeDoc = iframe.contentWindow.document;
    525525
     
    603603                                                editor.off( 'wp-body-class-change', classChange );
    604604                                        } );
    605605
    606                                         callback && callback.call( self, editor, node );
     606                                        callback && callback.call( self, editor, node, contentNode );
    607607                                }, 50 );
    608608                        }, rendered );
    609609                },