Ticket #29338: 29338.8.patch
File 29338.8.patch, 1.6 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/editor-expand.js
31 31 fixedSideBottom = false, 32 32 scrollTimer, 33 33 lastScrollPosition = 0, 34 visualEditorScrollPosition = 0, 35 textEditorScrollPosition = 0, 34 36 pageYOffsetAtTop = 130, 35 37 pinnedToolsTop = 56, 36 38 sidebarBottom = 20, … … 216 218 217 219 // Adjust when switching editor modes. 218 220 function mceShow() { 221 textEditorScrollPosition = window.pageYOffset; 222 219 223 setTimeout( function() { 224 var top = $contentWrap.offset().top; 225 226 if ( window.pageYOffset > top || visualEditorScrollPosition ) { 227 window.scrollTo( window.pageXOffset, visualEditorScrollPosition ? visualEditorScrollPosition : top - heights.adminBarHeight ); 228 } 229 220 230 editor.execCommand( 'wpAutoResize' ); 221 231 adjust(); 222 232 }, 300 ); 233 234 adjust(); 223 235 } 224 236 225 237 function mceHide() { 226 v ar wrapHeight = $( '#wpwrap' ).height();238 visualEditorScrollPosition = window.pageYOffset; 227 239 228 textEditorResize(); 240 setTimeout( function() { 241 var top = $contentWrap.offset().top; 229 242 230 if ( wrapHeight && $window.scrollTop() > wrapHeight ) { 231 window.scrollTo( window.pageXOffset, wrapHeight - 1 ); 232 } 243 if ( window.pageYOffset > top || textEditorScrollPosition ) { 244 window.scrollTo( window.pageXOffset, textEditorScrollPosition ? textEditorScrollPosition : top - heights.adminBarHeight ); 245 } 246 247 textEditorResize(); 248 adjust(); 249 }, 100 ); 233 250 234 251 adjust(); 235 252 }