Ticket #36482: 36482.8.patch
File 36482.8.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,20 19 $bottom = $( '#post-status-info' ), 21 20 $menuBar = $(), 22 21 $statusBar = $(), … … 76 75 } 77 76 78 77 function textEditorResize() { 79 var reduce, scrollHeight;80 81 78 if ( mceEditor && ! mceEditor.isHidden() ) { 82 79 return; 83 80 } … … 86 83 return; 87 84 } 88 85 89 reduce = textEditorLength > ( textEditorLength = textEditor.value.length ); 90 scrollHeight = textEditor.scrollHeight; 86 var length = textEditor.value.length; 91 87 92 if ( reduce ) { 88 // If there's less characters, we have to remove the height to know the scrollHeight. 89 if ( length < textEditorResize.oldLength ) { 93 90 textEditor.style.height = 'auto'; 94 textEditor.style.height = scrollHeight + 'px'; 95 adjust(); 96 } else if ( parseInt( textEditor.style.height, 10 ) < scrollHeight ) { 97 textEditor.style.height = scrollHeight + 'px'; 91 } 92 93 var height = parseInt( textEditor.style.height, 10 ); 94 var scrollHeight = textEditor.scrollHeight; 95 96 if ( scrollHeight !== height ) { 97 if ( scrollHeight < autoresizeMinHeight ) { 98 textEditor.style.height = autoresizeMinHeight + 'px'; 99 } else { 100 textEditor.style.height = scrollHeight + 'px'; 101 } 102 98 103 adjust(); 99 104 } 105 106 textEditorResize.oldLength = length; 100 107 } 101 108 102 109 // We need to wait for TinyMCE to initialize.