Skip to content

Commit 1121aad

Browse files
committed
Editor scrolling: reduce the amount of height jumping on load.
props avryl. fixes #29307. git-svn-id: https://develop.svn.wordpress.org/trunk@29628 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ad66613 commit 1121aad

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/wp-admin/edit-form-advanced.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
'dfw' => true,
497497
'drag_drop_upload' => true,
498498
'tabfocus_elements' => 'insert-media-button-1,save-post',
499-
'editor_height' => 360,
499+
'editor_height' => 300,
500500
'tinymce' => array(
501501
'resize' => false,
502502
'wp_autoresize_on' => ( ! empty( $_wp_autoresize_on ) && get_user_setting( 'editor_expand', 'on' ) === 'on' ),

src/wp-admin/js/editor-expand.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jQuery( document ).ready( function($) {
3434
pageYOffsetAtTop = 130,
3535
pinnedToolsTop = 56,
3636
autoresizeMinHeight = 300,
37+
initialMode = window.getUserSetting( 'editor' ),
3738
// These are corrected when adjust() runs, except on scrolling if already set.
3839
heights = {
3940
windowHeight: 0,
@@ -119,7 +120,7 @@ jQuery( document ).ready( function($) {
119120
}
120121

121122
function textEditorResize() {
122-
if ( mceEditor && ! mceEditor.isHidden() ) {
123+
if ( ( mceEditor && ! mceEditor.isHidden() ) || ( ! mceEditor && initialMode === 'tinymce' ) ) {
123124
return;
124125
}
125126

src/wp-includes/class-wp-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function parse_settings( $editor_id, $settings ) {
112112
if ( empty( $set['editor_height'] ) )
113113
return $set;
114114

115-
if ( 'content' === $editor_id ) {
115+
if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
116116
// A cookie (set when a user resizes the editor) overrides the height.
117117
$cookie = (int) get_user_setting( 'ed_size' );
118118

src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
2424
var settings = editor.settings,
25-
oldSize = 0,
25+
oldSize = 300,
2626
isActive = false;
2727

2828
function isFullscreen() {

0 commit comments

Comments
 (0)