Ticket #36482: 36482.9.patch
File 36482.9.patch, 1.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/editor-expand.js
16 16 $textTop = $( '#ed_toolbar' ), 17 17 $textEditor = $( '#content' ), 18 18 textEditor = $textEditor[0], 19 textEditorLength = 0,19 oldTextLength = 0, 20 20 $bottom = $( '#post-status-info' ), 21 21 $menuBar = $(), 22 22 $statusBar = $(), … … 76 76 } 77 77 78 78 function textEditorResize() { 79 var reduce, scrollHeight;80 81 79 if ( mceEditor && ! mceEditor.isHidden() ) { 82 80 return; 83 81 } … … 86 84 return; 87 85 } 88 86 89 reduce = textEditorLength > ( textEditorLength = textEditor.value.length ); 90 scrollHeight = textEditor.scrollHeight; 87 var length = textEditor.value.length; 91 88 92 if ( reduce ) { 89 if ( length < oldTextLength ) { 90 // textEditor.scrollHeight is not adjusted until the next line. 93 91 textEditor.style.height = 'auto'; 94 textEditor.style.height = scrollHeight + 'px'; 92 93 if ( textEditor.scrollHeight >= autoresizeMinHeight ) { 94 textEditor.style.height = textEditor.scrollHeight + 'px'; 95 adjust(); 96 } else { 97 textEditor.style.height = autoresizeMinHeight + 'px'; 98 } 99 } else if ( parseInt( textEditor.style.height, 10 ) < textEditor.scrollHeight ) { 100 textEditor.style.height = textEditor.scrollHeight + 'px'; 95 101 adjust(); 96 } else if ( parseInt( textEditor.style.height, 10 ) < scrollHeight ) {97 textEditor.style.height = scrollHeight + 'px';98 adjust();99 102 } 103 104 oldTextLength = length; 100 105 } 101 106 102 107 // We need to wait for TinyMCE to initialize.