()
| 98 | } |
| 99 | |
| 100 | function autoresize() { |
| 101 | var textarea = $('#kw-target'); |
| 102 | var width = textarea.width(); |
| 103 | var content = (textarea.val() + "a").replace(/\\n/g, '<br>'); |
| 104 | var div = $('<div>').css({ |
| 105 | 'position': 'absolute', |
| 106 | 'top': '-99999px', |
| 107 | 'border': '1px solid red', |
| 108 | 'width': width, |
| 109 | 'font-size': '15px', |
| 110 | 'line-height': '20px', |
| 111 | 'white-space': 'pre-wrap' |
| 112 | }).html(content).appendTo('body'); |
| 113 | var height = div.height(); |
| 114 | var rows = Math.ceil(height / 20); |
| 115 | div.remove(); |
| 116 | textarea.attr('rows', rows); |
| 117 | $("#article-wrapper").height(parseInt($(window).height()) - parseInt($("#fixed-block").height()) - parseInt($(".layout-header").height()) - 80); |
| 118 | } |
| 119 | |
| 120 | $(document).ready(function () { |
| 121 | initcode(); |
no test coverage detected
searching dependent graphs…