Ticket #29307: 29307.2.patch
File 29307.2.patch, 2.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
496 496 'dfw' => true, 497 497 'drag_drop_upload' => true, 498 498 'tabfocus_elements' => 'insert-media-button-1,save-post', 499 'editor_height' => 3 60,499 'editor_height' => 300, 500 500 'tinymce' => array( 501 501 'resize' => false, 502 502 'wp_autoresize_on' => ( ! empty( $_wp_autoresize_on ) && get_user_setting( 'editor_expand', 'on' ) === 'on' ), -
src/wp-includes/class-wp-editor.php
112 112 if ( empty( $set['editor_height'] ) ) 113 113 return $set; 114 114 115 if ( 'content' === $editor_id ) {115 if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) { 116 116 // A cookie (set when a user resizes the editor) overrides the height. 117 117 $cookie = (int) get_user_setting( 'ed_size' ); 118 118 -
src/wp-includes/js/tinymce/plugins/wpautoresize/plugin.js
37 37 return parseInt( n, 10 ) || 0; 38 38 } 39 39 40 function isEmpty() { 41 return editor.getContent( { format: 'raw' } ).replace( /(?:<p[^>]*>)?(?:<br[^>]*>)?(?:<\/p>)?/, '' ) === ''; 42 } 43 40 44 /** 41 45 * This method gets executed each time the editor needs to resize. 42 46 */ … … 48 52 return; 49 53 } 50 54 55 if ( isEmpty() ) { 56 return; 57 } 58 51 59 doc = editor.getDoc(); 52 60 if ( ! doc ) { 53 61 return; … … 108 116 // Resize content element 109 117 if (resizeHeight !== oldSize) { 110 118 deltaSize = resizeHeight - oldSize; 119 console.log( resizeHeight, oldSize, parseInt( DOM.getStyle( editor.iframeElement, 'height', true ), 10 ) ); 111 120 DOM.setStyle( editor.iframeElement, 'height', resizeHeight + 'px' ); 112 121 oldSize = resizeHeight; 113 122