mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-22 20:51:21 +00:00
avoid generation of multiple divs
This commit is contained in:
parent
e8f05c0df2
commit
60e63ff28f
2 changed files with 3 additions and 3 deletions
|
@ -208,8 +208,7 @@ haste.prototype.addLineNumbers = function(data) {
|
||||||
};
|
};
|
||||||
|
|
||||||
haste.prototype.getCharacterWidth = function() {
|
haste.prototype.getCharacterWidth = function() {
|
||||||
var $div = $("<div></div>");
|
var $div = $("#sandbox");
|
||||||
$("body").append($div);
|
|
||||||
$div.html('a');
|
$div.html('a');
|
||||||
$div.css('width','auto')
|
$div.css('width','auto')
|
||||||
.css('font', $("code").css('font'))
|
.css('font', $("code").css('font'))
|
||||||
|
|
|
@ -63,7 +63,8 @@
|
||||||
<div id="linenos"></div>
|
<div id="linenos"></div>
|
||||||
<pre id="box" style="display:none;" tabindex="0"><code></code></pre>
|
<pre id="box" style="display:none;" tabindex="0"><code></code></pre>
|
||||||
<textarea spellcheck="false" style="display:none;"></textarea>
|
<textarea spellcheck="false" style="display:none;"></textarea>
|
||||||
|
<div id="sandbox">
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue