Make WordPress Core

Ticket #31412: 31412-duplicate-iframe-content.diff

File 31412-duplicate-iframe-content.diff, 797 bytes (added by mattheu, 10 years ago)

Fix duplicate content in setIframes

  • src/wp-includes/js/mce-view.js

    diff --git a/src/wp-includes/js/mce-view.js b/src/wp-includes/js/mce-view.js
    index dad9ddc..87b8ffd 100644
    a b window.wp = window.wp || {}; 
    470470                                        bodyClasses = editor.getBody().className || '',
    471471                                        iframe, iframeDoc, observer, i;
    472472
    473                                 content.innerHTML = '';
    474473                                head = head || '';
    475474
    476475                                if ( importStyles ) {
    window.wp = window.wp || {}; 
    492491                                // Seems Firefox needs a bit of time to insert/set the view nodes,
    493492                                // or the iframe will fail especially when switching Text => Visual.
    494493                                setTimeout( function() {
     494
     495                                        content.innerHTML = '';
     496
    495497                                        iframe = dom.add( content, 'iframe', {
    496498                                                /* jshint scripturl: true */
    497499                                                src: tinymce.Env.ie ? 'javascript:""' : '',