Make WordPress Core

Ticket #29338: 29338.2.patch

File 29338.2.patch, 983 bytes (added by azaozz, 11 years ago)
  • src/wp-admin/js/editor-expand.js

     
    223223                }
    224224
    225225                function mceHide() {
    226                         var wrapHeight = $( '#wpwrap' ).height();
     226                        var wrapHeight = $( '#wpwrap' ).height(),
     227                                windowPos = $window.scrollTop(),
     228                                iframeHeight, textareaHeight;
    227229
    228230                        textEditorResize();
     231                        iframeHeight = $('#content_ifr').height();
     232                        textareaHeight = $textEditor.height();
    229233
    230                         if ( wrapHeight && $window.scrollTop() > wrapHeight ) {
     234                        if ( iframeHeight > textareaHeight && ( windowPos + heights.windowHeight ) > ( textareaHeight + $textEditor.offset().top ) ) {
     235                                window.scrollBy( 0, -( iframeHeight - textareaHeight - 1 ) );
     236                                adjust();
     237                                window.scrollBy( 0, 1 );
     238                        } else if ( wrapHeight && windowPos > wrapHeight ) {
    231239                                window.scrollTo( window.pageXOffset, wrapHeight - 1 );
    232240                        }
    233241