Ticket #28328: 28328.26.patch
File 28328.26.patch, 7.1 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/common.css
2255 2255 right: 0; 2256 2256 left: 0; 2257 2257 min-height: 100%; 2258 min-height: -webkit-calc( 100% - 346px ); 2258 2259 min-height: calc( 100% - 346px ); 2259 2260 } 2260 2261 -
src/wp-admin/css/edit.css
405 405 } 406 406 /* end editor-expand.js override */ 407 407 408 #poststuff #post-body #postbox-container-1.pinned { 409 position: fixed; 410 margin: 0; 411 top: 56px; 412 bottom: 0; 413 right: 20px; 414 -webkit-transition: top 200ms; 415 transition: top 200ms; 416 } 417 418 #postbox-container-1 #side-sortables { 419 padding-bottom: 1px; 420 } 421 408 422 #timestampdiv select { 409 423 height: 21px; 410 424 line-height: 14px; -
src/wp-admin/js/editor-expand.js
16 16 $textEditorClone = $( '<div id="content-textarea-clone"></div>' ), 17 17 $bottom = $( '#post-status-info' ), 18 18 $statusBar, 19 $sideSortables = $( '#side-sortables' ), 20 $postboxContainer = $('#postbox-container-1'), 21 $postBody = $('#post-body'), 19 22 fullscreen = window.wp.editor && window.wp.editor.fullscreen, 20 23 mceEditor, 21 24 mceBind = function(){}, … … 22 25 mceUnbind = function(){}, 23 26 fixedTop = false, 24 27 fixedBottom = false, 25 scrollTimer; 28 fixedSide = false, 29 scrolledSide = false, 30 scrollTimer, 31 lastScrollPosition = 0, 32 pageYOffsetAtTop = 130, 33 textEditorClonePaddingTop = 37, 34 autoresizeMinHeight = 300; // $window.height() - 310; 26 35 27 36 $textEditorClone.insertAfter( $textEditor ); 28 37 … … 31 40 'font-size': $textEditor.css( 'font-size' ), 32 41 'line-height': $textEditor.css( 'line-height' ), 33 42 'padding': $textEditor.css( 'padding' ), 34 'padding-top': 37,43 'padding-top': textEditorClonePaddingTop, 35 44 'white-space': 'pre-wrap', 36 45 'word-wrap': 'break-word' 37 46 } ); … … 88 97 89 98 hiddenHeight = $textEditorClone.height(); 90 99 91 if ( hiddenHeight < 300) {92 hiddenHeight = 300;100 if ( hiddenHeight < autoresizeMinHeight ) { 101 hiddenHeight = autoresizeMinHeight; 93 102 } 94 103 95 104 if ( hiddenHeight === textEditorHeight ) { … … 112 121 mceEditor = editor; 113 122 114 123 // Set the minimum height to the initial viewport height. 115 editor.settings.autoresize_min_height = 300;124 editor.settings.autoresize_min_height = autoresizeMinHeight; 116 125 117 126 // Get the necessary UI elements. 118 127 $visualTop = $contentWrap.find( '.mce-toolbar-grp' ); … … 218 227 adminBarHeight = windowWidth > 600 ? $adminBar.height() : 0, 219 228 resize = type !== 'scroll', 220 229 visual = ( mceEditor && ! mceEditor.isHidden() ), 221 buffer = 200, 230 buffer = autoresizeMinHeight + adminBarHeight, 231 postBodyTop = $postBody.offset().top, 232 borderWidth = 1, 222 233 $top, $editor, 223 toolsHeight, topPos, topHeight, editorPos, editorHeight, editorWidth, statusBarHeight ;234 toolsHeight, topPos, topHeight, editorPos, editorHeight, editorWidth, statusBarHeight, sideScrollTrigger; 224 235 225 236 if ( visual ) { 226 237 $top = $visualTop; … … 256 267 $tools.css( { 257 268 position: 'fixed', 258 269 top: adminBarHeight, 259 width: editorWidth + 2270 width: editorWidth + ( borderWidth * 2 ) 260 271 } ); 261 272 // Maybe unpin the top. 262 273 } else if ( fixedTop || resize ) { … … 287 298 288 299 $tools.css( { 289 300 position: 'absolute', 290 top: editorHeight - buffer + 1, // border301 top: editorHeight - buffer + borderWidth, // border 291 302 width: $contentWrap.width() 292 303 } ); 293 304 } … … 295 306 296 307 // Maybe adjust the bottom bar. 297 308 if ( ( ! fixedBottom || resize ) && 298 // + 1for the border around the .wp-editor-container.299 ( windowPos + windowHeight ) <= ( editorPos + editorHeight + bottomHeight + statusBarHeight + 1) ) {309 // +[n] for the border around the .wp-editor-container. 310 ( windowPos + windowHeight ) <= ( editorPos + editorHeight + bottomHeight + statusBarHeight + borderWidth ) ) { 300 311 fixedBottom = true; 301 312 302 313 $bottom.css( { 303 314 position: 'fixed', 304 315 bottom: 0, 305 width: editorWidth + 2,316 width: editorWidth + ( borderWidth * 2 ), 306 317 borderTop: '1px solid #dedede' 307 318 } ); 308 319 } else if ( ( fixedBottom || resize ) && 309 ( windowPos + windowHeight ) > ( editorPos + editorHeight + bottomHeight + statusBarHeight - 1) ) {320 ( windowPos + windowHeight ) > ( editorPos + editorHeight + bottomHeight + statusBarHeight - borderWidth ) ) { 310 321 fixedBottom = false; 311 322 312 323 $bottom.css( { … … 317 328 } ); 318 329 } 319 330 331 // The sidebar is on the left and the scrolling height is large enough, pin it. 332 if ( $postboxContainer.width() < 300 && windowWidth > 600 && 333 $document.height() > ( $sideSortables.height() + postBodyTop + 120 ) ) { 334 335 if ( ! fixedSide && ( postBodyTop - 56 ) < windowPos ) { 336 fixedSide = true; 337 $postboxContainer.addClass( 'pinned' ); 338 } else if ( fixedSide ) { 339 if ( ( postBodyTop - 56 ) >= windowPos ) { 340 fixedSide = false; 341 $postboxContainer.removeClass( 'pinned' ); 342 } 343 } 344 345 if ( fixedSide && windowPos > lastScrollPosition ) { 346 // Scrolling down 347 sideScrollTrigger = ( $sideSortables.height() - ( windowHeight - 56 ) ); 348 349 if ( ! scrolledSide && sideScrollTrigger > 1 && windowPos > sideScrollTrigger && windowPos > $wrap.offset().top ) { 350 scrolledSide = true; 351 $postboxContainer.css( 'top', -( sideScrollTrigger - 36 ) ); 352 } 353 } else if ( scrolledSide && windowPos < lastScrollPosition ) { 354 scrolledSide = false; 355 $postboxContainer.css( 'top', '' ); 356 } 357 358 lastScrollPosition = windowPos; 359 } else { 360 // Unpin 361 $postboxContainer.removeClass( 'pinned' ); 362 $postboxContainer.css( 'top', '' ); 363 scrolledSide = fixedSide = false; 364 } 365 320 366 if ( resize ) { 321 367 $contentWrap.css( { 322 368 paddingTop: $tools.outerHeight() … … 354 400 function on() { 355 401 // Scroll to the top when triggering this from JS. 356 402 // Ensures toolbars are pinned properly. 357 if ( window.pageYOffset && window.pageYOffset > 130) {403 if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) { 358 404 window.scrollTo( window.pageXOffset, 0 ); 359 405 } 360 406 … … 397 443 398 444 // Scroll to the top when triggering this from JS. 399 445 // Ensures toolbars are reset properly. 400 if ( window.pageYOffset && window.pageYOffset > 130) {446 if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) { 401 447 window.scrollTo( window.pageXOffset, 0 ); 402 448 } 403 449 -
src/wp-includes/js/media-grid.js
1 /* global _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings , confirm*/1 /* global _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ 2 2 (function($, _, Backbone, wp) { 3 3 // Local reference to the WordPress media namespace. 4 4 var media = wp.media, l10n;