Ticket #27761: 27761.2.diff
File 27761.2.diff, 1.4 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/dashboard.js
152 152 // propertychange is for IE < 9 153 153 editor.on('focus input propertychange', function() { 154 154 var $this = $(this), 155 oldIE = document.documentMode && document.documentMode < 9, // IE < 9 155 156 // is to ensure that the height of a final trailing newline is included. 156 157 textareaContent = $this.val() + ' ', 157 158 // 2px is for border-top & border-bottom … … 158 159 cloneHeight = clone.css('width', $this.css('width')).text(textareaContent).outerHeight() + 2; 159 160 160 161 // Default to having scrollbars 161 editor.css('overflow-y', 'auto'); 162 if ( oldIE ) { 163 cloneHeight += 10; 164 } else { 165 editor.css('overflow-y', 'auto'); 166 } 162 167 163 168 // Only change the height if it has indeed changed and both heights are below the max. 164 169 if ( cloneHeight === editorHeight || ( cloneHeight >= editorMaxHeight && editorHeight >= editorMaxHeight ) ) { … … 173 178 editorHeight = cloneHeight; 174 179 } 175 180 176 // No scrollbars as we change height 177 editor.css('overflow-y', 'hidden'); 181 // No scrollbars as we change height, not for IE < 9 182 if ( ! oldIE ) { 183 editor.css('overflow-y', 'hidden'); 184 } 178 185 179 186 $this.css('height', editorHeight + 'px'); 180 187 });