1
0
Fork 0
mirror of https://github.com/seejohnrun/haste-server.git synced 2024-11-22 12:41:21 +00:00

avoid generation of multiple divs

This commit is contained in:
Jishnu Mohan 2012-11-18 14:20:24 +05:30
parent e8f05c0df2
commit 60e63ff28f
2 changed files with 3 additions and 3 deletions

View file

@ -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'))

View file

@ -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>