mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
0eaa3d9088
commit
86373f3a4b
@ -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();
|
||||
|
2
wp-admin/js/editor-expand.min.js
vendored
2
wp-admin/js/editor-expand.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user