Editor expand: revert back to scrolling to the editor top when switching Visual to Text, fixes #29338

Built from https://develop.svn.wordpress.org/trunk@29698


git-svn-id: http://core.svn.wordpress.org/trunk@29473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-09-03 18:04:16 +00:00
parent 0eaa3d9088
commit 86373f3a4b
2 changed files with 3 additions and 17 deletions

View File

@ -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();

File diff suppressed because one or more lines are too long