Make WordPress Core

Changeset 32255


Ignore:
Timestamp:
04/21/2015 06:35:50 PM (10 years ago)
Author:
azaozz
Message:

TinyMCE wpView: ensure contentNode is passed to all callbacks.
Props iseulde. Fixes #31669.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r32056 r32255  
    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 {
     
    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 );
     
    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 = '',
     
    505505                    var iframe, iframeDoc, observer, i;
    506506
    507                     content.innerHTML = '';
    508 
    509                     iframe = dom.add( content, 'iframe', {
     507                    contentNode.innerHTML = '';
     508
     509                    iframe = dom.add( contentNode, 'iframe', {
    510510                        /* jshint scripturl: true */
    511511                        src: tinymce.Env.ie ? 'javascript:""' : '',
     
    520520                    } );
    521521
    522                     dom.add( content, 'div', { 'class': 'wpview-overlay' } );
     522                    dom.add( contentNode, 'div', { 'class': 'wpview-overlay' } );
    523523
    524524                    iframeDoc = iframe.contentWindow.document;
     
    604604                    } );
    605605
    606                     callback && callback.call( self, editor, node );
     606                    callback && callback.call( self, editor, node, contentNode );
    607607                }, 50 );
    608608            }, rendered );
Note: See TracChangeset for help on using the changeset viewer.