Ticket #38850: 38850.patch
File 38850.patch, 3.4 KB (added by , 7 years ago) |
---|
-
src/wp-admin/css/edit.css
391 391 z-index: 999; 392 392 } 393 393 394 .wp-editor-expand .wp-editor-tools { 395 position: sticky; 396 position: -webkit-sticky; 397 top: 32px; 398 } 399 400 .wp-editor-expand div.mce-toolbar-grp, 401 .wp-editor-expand .quicktags-toolbar { 402 position: sticky; 403 position: -webkit-sticky; 404 top: 87px; /* admin bar height + tools height */ 405 } 406 394 407 /* TinyMCE native fullscreen mode override */ 395 408 .mce-fullscreen #wp-content-wrap .mce-menubar, 396 409 .mce-fullscreen #wp-content-wrap .mce-toolbar-grp, -
src/wp-admin/js/editor-expand.js
6 6 $adminBar = $( '#wpadminbar' ), 7 7 $footer = $( '#wpfooter' ); 8 8 9 var featureSticky = ( function() { 10 var element = document.createElement( 'div' ); 11 var style = element.style; 12 13 style.cssText = 'position:sticky;position:-webkit-sticky'; 14 15 return !! style.position; 16 } )(); 17 9 18 /* Autoresize editor. */ 10 19 $( function() { 11 20 var $wrap = $( '#postdivrich' ), … … 333 342 334 343 if ( ! canPin ) { 335 344 if ( resize ) { 345 if ( ! featureSticky ) { 336 346 $tools.css( { 337 347 position: 'absolute', 338 348 top: 0, … … 352 362 top: heights.menuBarHeight, 353 363 width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) ) 354 364 } ); 365 } 355 366 356 367 $statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' ); 357 368 $bottom.attr( 'style', '' ); … … 365 376 windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) ) { 366 377 fixedTop = true; 367 378 379 if ( ! featureSticky ) { 368 380 $tools.css( { 369 381 position: 'fixed', 370 382 top: heights.adminBarHeight, … … 384 396 top: heights.adminBarHeight + heights.toolsHeight + heights.menuBarHeight, 385 397 width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) ) 386 398 } ); 399 } 387 400 // Maybe unpin the top. 388 401 } else if ( fixedTop || resize ) { 389 402 // Handle scrolling up. 390 403 if ( windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight ) ) { 391 404 fixedTop = false; 392 405 406 if ( ! featureSticky ) { 393 407 $tools.css( { 394 408 position: 'absolute', 395 409 top: 0, … … 409 423 top: heights.menuBarHeight, 410 424 width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) ) 411 425 } ); 426 } 412 427 // Handle scrolling down. 413 428 } else if ( windowPos >= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) { 414 429 fixedTop = false; 415 430 431 if ( ! featureSticky ) { 416 432 $tools.css( { 417 433 position: 'absolute', 418 434 top: editorHeight - buffer, … … 432 448 top: editorHeight - buffer + heights.menuBarHeight, 433 449 width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) ) 434 450 } ); 451 } 435 452 } 436 453 } 437 454 … … 558 575 fixedSideTop = fixedSideBottom = false; 559 576 } 560 577 561 if ( resize ) {578 if ( resize && ! featureSticky ) { 562 579 $contentWrap.css( { 563 580 paddingTop: heights.toolsHeight 564 581 } );