WordPress.org

Make WordPress Core

Changeset 32056


Ignore:
Timestamp:
04/06/2015 06:54:22 PM (5 years ago)
Author:
azaozz
Message:

TinyMCE wpView: resize sandbox iframes on load. Fixes a problem with resizing after all images are loaded.
Props iseulde, mattheu. Fixes #31480.

File:
1 edited

Legend:

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

    r32022 r32056  
    490490                    styles = '',
    491491                    bodyClasses = editor.getBody().className || '',
    492                     editorHead = editor.getDoc().getElementsByTagName( 'head' )[0],
    493                     iframe, iframeDoc, observer, i;
     492                    editorHead = editor.getDoc().getElementsByTagName( 'head' )[0];
    494493
    495494                tinymce.each( dom.$( 'link[rel="stylesheet"]', editorHead ), function( link ) {
     
    504503                // or the iframe will fail especially when switching Text => Visual.
    505504                setTimeout( function() {
     505                    var iframe, iframeDoc, observer, i;
     506
    506507                    content.innerHTML = '';
    507508
     
    573574                    }
    574575
     576                    $( iframe.contentWindow ).on( 'load', resize );
     577
    575578                    if ( MutationObserver ) {
    576579                        observer = new MutationObserver( _.debounce( resize, 100 ) );
Note: See TracChangeset for help on using the changeset viewer.