avoid generation of multiple divs
This commit is contained in:
parent
e8f05c0df2
commit
60e63ff28f
|
@ -208,8 +208,7 @@ haste.prototype.addLineNumbers = function(data) {
|
|||
};
|
||||
|
||||
haste.prototype.getCharacterWidth = function() {
|
||||
var $div = $("<div></div>");
|
||||
$("body").append($div);
|
||||
var $div = $("#sandbox");
|
||||
$div.html('a');
|
||||
$div.css('width','auto')
|
||||
.css('font', $("code").css('font'))
|
||||
|
|
|
@ -63,7 +63,8 @@
|
|||
<div id="linenos"></div>
|
||||
<pre id="box" style="display:none;" tabindex="0"><code></code></pre>
|
||||
<textarea spellcheck="false" style="display:none;"></textarea>
|
||||
|
||||
<div id="sandbox">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue