diff --git src/wp-admin/js/editor-expand.js src/wp-admin/js/editor-expand.js
index bf67c64..3b1f026 100644
|
|
|
|
| 277 | 277 | } |
| 278 | 278 | } ); |
| 279 | 279 | |
| | 280 | function debouncedScrollHandler() { |
| | 281 | return _.debounce( function( event ) { |
| | 282 | adjust( event.type ); |
| | 283 | }, 100 ); |
| | 284 | } |
| | 285 | |
| 280 | 286 | // Adjust the toolbars based on the active editor mode. |
| 281 | 287 | function adjust( event ) { |
| 282 | 288 | // Make sure we're not in fullscreen mode. |
| … |
… |
|
| 582 | 588 | } |
| 583 | 589 | } |
| 584 | 590 | |
| 585 | | function afterScroll() { |
| 586 | | clearTimeout( scrollTimer ); |
| 587 | | scrollTimer = setTimeout( adjust, 100 ); |
| 588 | | } |
| 589 | | |
| 590 | 591 | function on() { |
| 591 | 592 | // Scroll to the top when triggering this from JS. |
| 592 | 593 | // Ensures toolbars are pinned properly. |
| … |
… |
|
| 597 | 598 | $wrap.addClass( 'wp-editor-expand' ); |
| 598 | 599 | |
| 599 | 600 | // Adjust when the window is scrolled or resized. |
| 600 | | $window.on( 'scroll.editor-expand resize.editor-expand', function( event ) { |
| 601 | | adjust( event.type ); |
| 602 | | afterScroll(); |
| 603 | | } ); |
| | 601 | $window.on( 'scroll.editor-expand resize.editor-expand', debouncedScrollHandler() ); |
| 604 | 602 | |
| 605 | 603 | // Adjust when collapsing the menu, changing the columns, changing the body class. |
| 606 | 604 | $document.on( 'wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand', adjust ) |