mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +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,
|
fixedSideBottom = false,
|
||||||
scrollTimer,
|
scrollTimer,
|
||||||
lastScrollPosition = 0,
|
lastScrollPosition = 0,
|
||||||
visualEditorScrollPosition = 0,
|
|
||||||
textEditorScrollPosition = 0,
|
|
||||||
pageYOffsetAtTop = 130,
|
pageYOffsetAtTop = 130,
|
||||||
pinnedToolsTop = 56,
|
pinnedToolsTop = 56,
|
||||||
sidebarBottom = 20,
|
sidebarBottom = 20,
|
||||||
@ -226,30 +224,18 @@ jQuery( document ).ready( function($) {
|
|||||||
|
|
||||||
// Adjust when switching editor modes.
|
// Adjust when switching editor modes.
|
||||||
function mceShow() {
|
function mceShow() {
|
||||||
textEditorScrollPosition = window.pageYOffset;
|
|
||||||
|
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
var top = $contentWrap.offset().top;
|
|
||||||
|
|
||||||
if ( window.pageYOffset > top || visualEditorScrollPosition ) {
|
|
||||||
window.scrollTo( window.pageXOffset, visualEditorScrollPosition ? visualEditorScrollPosition : top - heights.adminBarHeight );
|
|
||||||
}
|
|
||||||
|
|
||||||
editor.execCommand( 'wpAutoResize' );
|
editor.execCommand( 'wpAutoResize' );
|
||||||
adjust();
|
adjust();
|
||||||
}, 300 );
|
}, 300 );
|
||||||
|
|
||||||
adjust();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mceHide() {
|
function mceHide() {
|
||||||
visualEditorScrollPosition = window.pageYOffset;
|
|
||||||
|
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
var top = $contentWrap.offset().top;
|
var top = $contentWrap.offset().top;
|
||||||
|
|
||||||
if ( window.pageYOffset > top || textEditorScrollPosition ) {
|
if ( window.pageYOffset > top ) {
|
||||||
window.scrollTo( window.pageXOffset, textEditorScrollPosition ? textEditorScrollPosition : top - heights.adminBarHeight );
|
window.scrollTo( window.pageXOffset, top - heights.adminBarHeight );
|
||||||
}
|
}
|
||||||
|
|
||||||
textEditorResize();
|
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