Editor scrolling: fix window height when switching Visual to Text and the editor is shorter. Props mackensen, fixes #29226.

git-svn-id: https://develop.svn.wordpress.org/trunk@29592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
azaozz 2014-08-24 23:11:03 +00:00
parent 4820f78f66
commit 78b5ccd55c
1 changed files with 12 additions and 0 deletions

View File

@ -73,6 +73,11 @@ jQuery( document ).ready( function($) {
statusBarHeight: $statusBar.outerHeight() || 0, statusBarHeight: $statusBar.outerHeight() || 0,
sideSortablesHeight: $sideSortables.height() || 0 sideSortablesHeight: $sideSortables.height() || 0
}; };
// Adjust for hidden
if ( heights.menuBarHeight < 3 ) {
heights.menuBarHeight = 0;
}
} }
function textEditorKeyup( event ) { function textEditorKeyup( event ) {
@ -216,7 +221,14 @@ jQuery( document ).ready( function($) {
} }
function mceHide() { function mceHide() {
var wrapHeight = $( '#wpwrap' ).height();
textEditorResize(); textEditorResize();
if ( wrapHeight && $window.scrollTop() > wrapHeight ) {
window.scrollTo( window.pageXOffset, wrapHeight - 1 );
}
adjust(); adjust();
} }