mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor expand: revert back to scrolling to the editor top when switching Visual to Text, fixes #29338
git-svn-id: https://develop.svn.wordpress.org/trunk@29698 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f5e371608c
commit
44466b7627
@ -31,8 +31,6 @@ jQuery( document ).ready( function($) {
|
||||
fixedSideBottom = false,
|
||||
scrollTimer,
|
||||
lastScrollPosition = 0,
|
||||
visualEditorScrollPosition = 0,
|
||||
textEditorScrollPosition = 0,
|
||||
pageYOffsetAtTop = 130,
|
||||
pinnedToolsTop = 56,
|
||||
sidebarBottom = 20,
|
||||
@ -226,30 +224,18 @@ jQuery( document ).ready( function($) {
|
||||
|
||||
// Adjust when switching editor modes.
|
||||
function mceShow() {
|
||||
textEditorScrollPosition = window.pageYOffset;
|
||||
|
||||
setTimeout( function() {
|
||||
var top = $contentWrap.offset().top;
|
||||
|
||||
if ( window.pageYOffset > top || visualEditorScrollPosition ) {
|
||||
window.scrollTo( window.pageXOffset, visualEditorScrollPosition ? visualEditorScrollPosition : top - heights.adminBarHeight );
|
||||
}
|
||||
|
||||
editor.execCommand( 'wpAutoResize' );
|
||||
adjust();
|
||||
}, 300 );
|
||||
|
||||
adjust();
|
||||
}
|
||||
|
||||
function mceHide() {
|
||||
visualEditorScrollPosition = window.pageYOffset;
|
||||
|
||||
setTimeout( function() {
|
||||
var top = $contentWrap.offset().top;
|
||||
|
||||
if ( window.pageYOffset > top || textEditorScrollPosition ) {
|
||||
window.scrollTo( window.pageXOffset, textEditorScrollPosition ? textEditorScrollPosition : top - heights.adminBarHeight );
|
||||
if ( window.pageYOffset > top ) {
|
||||
window.scrollTo( window.pageXOffset, top - heights.adminBarHeight );
|
||||
}
|
||||
|
||||
textEditorResize();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user