Ticket #37690: 37690.patch
| File 37690.patch, 2.2 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/js/editor-expand.js
16 16 $textTop = $( '#ed_toolbar' ), 17 17 $textEditor = $( '#content' ), 18 18 textEditor = $textEditor[0], 19 $textEditorClone = $textEditor.clone().attr({ id: 'content-clone', name: null }), 20 textEditorClone = $textEditorClone[0], 19 21 oldTextLength = 0, 20 22 $bottom = $( '#post-status-info' ), 21 23 $menuBar = $(), … … 76 78 } 77 79 78 80 function textEditorResize() { 79 if ( mceEditor && ! mceEditor.isHidden()) {81 if ( ( mceEditor && ! mceEditor.isHidden() ) || ! textEditorClone ) { 80 82 return; 81 83 } 82 84 … … 89 91 var top = window.scrollTop; 90 92 91 93 if ( length < oldTextLength ) { 92 // textEditor.scrollHeight is not adjusted until the next line.93 textEditor.style.height = 'auto';94 if ( oldTextLength - length === 1 ) { 95 textEditor.style.height = ( height - 19 ) + 'px'; 94 96 95 if ( textEditor.scrollHeight > autoresizeMinHeight ) { 96 textEditor.style.height = textEditor.scrollHeight + 'px'; 97 if ( textEditor.scrollHeight > autoresizeMinHeight ) { 98 textEditor.style.height = textEditor.scrollHeight + 'px'; 99 } else { 100 textEditor.style.height = autoresizeMinHeight + 'px'; 101 } 97 102 } else { 98 textEditor.style.height = autoresizeMinHeight + 'px'; 103 textEditorClone.value = textEditor.value; 104 105 if ( textEditorClone.scrollHeight > autoresizeMinHeight ) { 106 textEditor.style.height = textEditorClone.scrollHeight + 'px'; 107 } else if ( textEditorClone.scrollHeight < height ) { 108 textEditor.style.height = autoresizeMinHeight + 'px'; 109 } 99 110 } 100 111 101 112 // Prevent scroll-jumping in Firefox and IE. … … 112 123 oldTextLength = length; 113 124 } 114 125 126 // Append the cloned textarea after the "real" one and move it off screen. 127 $textEditor.after( $textEditorClone.css({ position: 'absolute', left: '-10000em' }) ); 128 115 129 // We need to wait for TinyMCE to initialize. 116 130 $document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) { 117 131 var VK = window.tinymce.util.VK,
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)