Make WordPress Core

Ticket #33286: 33286.2.patch

File 33286.2.patch, 1.5 KB (added by iseulde, 8 years ago)
  • src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

     
    559559                        timeout,
    560560                        wpAdminbar = document.getElementById( 'wpadminbar' ),
    561561                        mceIframe = document.getElementById( editor.id + '_ifr' ),
    562                         mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0],
    563                         mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0],
     562                        mceToolbar,
     563                        mceStatusbar,
    564564                        wpStatusbar;
    565565
     566                        if ( editor.getContainer() ) {
     567                                mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0];
     568                                mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0];
     569                        }
     570
    566571                        if ( editor.id === 'content' ) {
    567572                                wpStatusbar = document.getElementById( 'post-status-info' );
    568573                        }
     
    702707                                        scrollY = window.pageYOffset || document.documentElement.scrollTop,
    703708                                        windowWidth = window.innerWidth,
    704709                                        windowHeight = window.innerHeight,
    705                                         iframeRect = mceIframe.getBoundingClientRect(),
     710                                        iframeRect = mceIframe ? mceIframe.getBoundingClientRect() : {
     711                                                top: 0,
     712                                                right: windowWidth,
     713                                                bottom: windowHeight,
     714                                                left: 0,
     715                                                width: windowWidth,
     716                                                height: windowHeight
     717                                        },
    706718                                        toolbar = this.getEl(),
    707719                                        toolbarWidth = toolbar.offsetWidth,
    708720                                        toolbarHeight = toolbar.offsetHeight,