From 27cd1b4f9243cb76045dd94846c402f4d299385e Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 18 Aug 2014 01:12:31 +0000 Subject: [PATCH] Editor scrolling: set max-width: 100% for the text editor clone instead of always resizing it. See #29246. git-svn-id: https://develop.svn.wordpress.org/trunk@29524 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/edit.css | 1 + src/wp-admin/js/editor-expand.js | 6 +++--- src/wp-admin/js/postbox.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/css/edit.css b/src/wp-admin/css/edit.css index ff8cd0d8b4..c6fbb92d97 100644 --- a/src/wp-admin/css/edit.css +++ b/src/wp-admin/css/edit.css @@ -385,6 +385,7 @@ td.plugin-title p { top: 0; visibility: hidden; overflow: hidden; + max-width: 100%; } .wp-fullscreen-wrap #content-textarea-clone { diff --git a/src/wp-admin/js/editor-expand.js b/src/wp-admin/js/editor-expand.js index b2caebfea5..04289e3cc0 100644 --- a/src/wp-admin/js/editor-expand.js +++ b/src/wp-admin/js/editor-expand.js @@ -91,7 +91,7 @@ jQuery( document ).ready( function($) { var textEditorHeight = $textEditor.height(), hiddenHeight; - $textEditorClone.width( $textEditor.width() ); + $textEditorClone.width( $textEditor.width() - 22 ); $textEditorClone.text( $textEditor.val() + ' ' ); hiddenHeight = $textEditorClone.height(); @@ -461,9 +461,9 @@ jQuery( document ).ready( function($) { $textEditor.css( { marginTop: $textTop.outerHeight() } ); + + $textEditorClone.width( contentWrapWidth - 20 - ( borderWidth * 2 ) ); } - // ALways resize the clone so it doesn't "push" the parent width over 100% - $textEditorClone.width( contentWrapWidth - 20 - ( borderWidth * 2 ) ); } } diff --git a/src/wp-admin/js/postbox.js b/src/wp-admin/js/postbox.js index 5fc24e846c..07e5ed25b3 100644 --- a/src/wp-admin/js/postbox.js +++ b/src/wp-admin/js/postbox.js @@ -49,11 +49,11 @@ var postboxes; if ( $(this).prop('checked') ) { $postbox.show(); if ( $.isFunction( postboxes.pbshow ) ) - self.pbshow( box ); + self.pbshow( boxId ); } else { $postbox.hide(); if ( $.isFunction( postboxes.pbhide ) ) - self.pbhide( box ); + self.pbhide( boxId ); } self.save_state(page); self._mark_area();