Editor scrolling: always resize the text editor clone so it doesn't "push" the parent's width over 100%, fixes #29246.

git-svn-id: https://develop.svn.wordpress.org/trunk@29522 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-08-17 21:32:10 +00:00
parent ed01241d4b
commit 53488d1404
1 changed files with 4 additions and 6 deletions

View File

@ -31,9 +31,8 @@ jQuery( document ).ready( function($) {
scrollTimer,
lastScrollPosition = 0,
pageYOffsetAtTop = 130,
pinnedToolsTop = 56, // also used in CSS for the "#poststuff #post-body #postbox-container-1.pinned" selector
textEditorClonePaddingTop = 37,
autoresizeMinHeight = 300; // $window.height() - 310;
pinnedToolsTop = 56,
autoresizeMinHeight = 300;
$textEditorClone.insertAfter( $textEditor );
@ -41,8 +40,6 @@ jQuery( document ).ready( function($) {
'font-family': $textEditor.css( 'font-family' ),
'font-size': $textEditor.css( 'font-size' ),
'line-height': $textEditor.css( 'line-height' ),
'padding': $textEditor.css( 'padding' ),
'padding-top': textEditorClonePaddingTop,
'white-space': 'pre-wrap',
'word-wrap': 'break-word'
} );
@ -438,8 +435,9 @@ jQuery( document ).ready( function($) {
$textEditor.css( {
marginTop: $textTop.outerHeight()
} );
$textEditorClone.width( $textEditor.width() );
}
// ALways resize the clone so it doesn't "push" the parent width over 100%
$textEditorClone.width( contentWrapWidth - 20 - ( borderWidth * 2 ) );
}
}