Make WordPress Core

Changeset 29352


Ignore:
Timestamp:
08/01/2014 09:42:03 PM (10 years ago)
Author:
azaozz
Message:

Editor scrolling: run one more adjust() 200ms after scroll or resize in case the browser is slow to re-calculate the element heights and pin/unpin the toolbars. See #28328, fixes #29059.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/editor-expand.js

    r29336 r29352  
    2222        mceUnbind = function(){},
    2323        fixedTop = false,
    24         fixedBottom = false;
     24        fixedBottom = false,
     25        scrollTimer;
    2526
    2627    $textEditorClone.insertAfter( $textEditor );
     
    346347    }
    347348
     349    function afterScroll() {
     350        clearTimeout( scrollTimer );
     351        scrollTimer = setTimeout( adjust, 200 );
     352    }
     353
    348354    function on() {
    349355        // Scroll to the top when triggering this from JS.
     
    358364        $window.on( 'scroll.editor-expand resize.editor-expand', function( event ) {
    359365            adjust( event.type );
     366            afterScroll();
    360367        } );
    361368
Note: See TracChangeset for help on using the changeset viewer.