Changeset 29656
- Timestamp:
- 09/01/2014 06:48:07 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/editor-expand.js
r29628 r29656 34 34 pageYOffsetAtTop = 130, 35 35 pinnedToolsTop = 56, 36 sidebarBottom = 20, 36 37 autoresizeMinHeight = 300, 37 38 initialMode = window.getUserSetting( 'editor' ), … … 433 434 heights.windowHeight < editorHeight ) { // the editor is taller than the viewport 434 435 435 if ( heights.sideSortablesHeight> heights.windowHeight || fixedSideTop || fixedSideBottom ) {436 if ( ( heights.sideSortablesHeight + pinnedToolsTop + sidebarBottom ) > heights.windowHeight || fixedSideTop || fixedSideBottom ) { 436 437 // Reset when scrolling to the top 437 438 if ( windowPos + pinnedToolsTop <= postBodyTop ) { … … 448 449 449 450 // don't get over the footer 450 if ( footerTop < sidebarTop + heights.sideSortablesHeight + 20) {451 sidebarTop = footerTop - heights.sideSortablesHeight - 20;451 if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) { 452 sidebarTop = footerTop - heights.sideSortablesHeight - 12; 452 453 } 453 454 … … 457 458 bottom: '' 458 459 }); 459 } else if ( ! fixedSideBottom && heights.sideSortablesHeight + $sideSortables.offset().top + 20< windowPos + heights.windowHeight ) {460 } else if ( ! fixedSideBottom && heights.sideSortablesHeight + $sideSortables.offset().top + sidebarBottom < windowPos + heights.windowHeight ) { 460 461 // pin the bottom 461 462 fixedSideBottom = true; … … 464 465 position: 'fixed', 465 466 top: 'auto', 466 bottom: '20px'467 bottom: sidebarBottom 467 468 }); 468 469 } … … 472 473 // let it scroll 473 474 fixedSideBottom = false; 474 sidebarTop = $sideSortables.offset().top - 20;475 sidebarTop = $sideSortables.offset().top - sidebarBottom; 475 476 footerTop = $footer.offset().top; 476 477 477 478 // don't get over the footer 478 if ( footerTop < sidebarTop + heights.sideSortablesHeight + 20) {479 sidebarTop = footerTop - heights.sideSortablesHeight - 20;479 if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) { 480 sidebarTop = footerTop - heights.sideSortablesHeight - 12; 480 481 } 481 482 … … 500 501 // if the sidebar container is smaller than the viewport, then pin/unpin the top when scrolling 501 502 if ( windowPos >= ( postBodyTop - pinnedToolsTop ) ) { 503 502 504 $sideSortables.css( { 503 505 position: 'fixed', … … 570 572 $document.on( 'wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand', adjust ) 571 573 .on( 'postbox-toggled.editor-expand', function() { 572 if ( ! fixedSideTop && ! fixedSideBottom && window.pageYOffset > 20) {574 if ( ! fixedSideTop && ! fixedSideBottom && window.pageYOffset > pinnedToolsTop ) { 573 575 fixedSideBottom = true; 574 576 window.scrollBy( 0, -1 );
Note: See TracChangeset
for help on using the changeset viewer.