Make WordPress Core

Changeset 31466


Ignore:
Timestamp:
02/15/2015 06:18:06 PM (12 years ago)
Author:
azaozz
Message:

TinyMCE wpView: fire nodeChanged when an embedded iframe is resized so we can adjust the editor height and other UI components. Props iseulde, fixes #30646.

File:
1 edited

Legend:

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

    r31343 r31466  
    208208
    209209                                                resize = function() {
     210                                                        var $iframe, iframeDocHeight;
     211
    210212                                                        // Make sure the iframe still exists.
    211                                                         iframe.contentWindow && $( iframe ).height( $( iframeDoc.body ).height() );
     213                                                        if ( iframe.contentWindow ) {
     214                                                                $iframe = $( iframe );
     215                                                                iframeDocHeight = $( iframeDoc.body ).height();
     216
     217                                                                if ( $iframe.height() !== iframeDocHeight ) {
     218                                                                        $iframe.height( iframeDocHeight );
     219                                                                        editor.nodeChanged();
     220                                                                }
     221                                                        }
    212222                                                };
    213223
Note: See TracChangeset for help on using the changeset viewer.