From 53488d1404f11b6f4194f6731ef19167b228430b Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 17 Aug 2014 21:32:10 +0000 Subject: [PATCH] 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 --- src/wp-admin/js/editor-expand.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/js/editor-expand.js b/src/wp-admin/js/editor-expand.js index e4fcd9038d..700954df29 100644 --- a/src/wp-admin/js/editor-expand.js +++ b/src/wp-admin/js/editor-expand.js @@ -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 ) ); } }