mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
only try to redraw the line height of lines that exist..
This commit is contained in:
parent
5b1de1421c
commit
f135f79d13
1 changed files with 12 additions and 7 deletions
|
@ -5180,7 +5180,6 @@ function Ace2Inner(){
|
||||||
{
|
{
|
||||||
if(n > lineNumbersShown) //all updated, break
|
if(n > lineNumbersShown) //all updated, break
|
||||||
break;
|
break;
|
||||||
|
|
||||||
var h = (b.clientHeight || b.offsetHeight);
|
var h = (b.clientHeight || b.offsetHeight);
|
||||||
if (b.nextSibling)
|
if (b.nextSibling)
|
||||||
{
|
{
|
||||||
|
@ -5215,18 +5214,24 @@ function Ace2Inner(){
|
||||||
var n = lineNumbersShown;
|
var n = lineNumbersShown;
|
||||||
var div = odoc.createElement("DIV");
|
var div = odoc.createElement("DIV");
|
||||||
//calculate height for new line number
|
//calculate height for new line number
|
||||||
|
if(b){
|
||||||
var h = (b.clientHeight || b.offsetHeight);
|
var h = (b.clientHeight || b.offsetHeight);
|
||||||
|
|
||||||
if (b.nextSibling)
|
if (b.nextSibling){
|
||||||
h = b.nextSibling.offsetTop - b.offsetTop;
|
h = b.nextSibling.offsetTop - b.offsetTop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(h) // apply style to div
|
if(h){ // apply style to div
|
||||||
div.style.height = h +"px";
|
div.style.height = h +"px";
|
||||||
|
}
|
||||||
|
|
||||||
div.appendChild(odoc.createTextNode(String(n)));
|
div.appendChild(odoc.createTextNode(String(n)));
|
||||||
fragment.appendChild(div);
|
fragment.appendChild(div);
|
||||||
|
if(b){
|
||||||
b = b.nextSibling;
|
b = b.nextSibling;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
container.appendChild(fragment);
|
container.appendChild(fragment);
|
||||||
while (lineNumbersShown > newNumLines)
|
while (lineNumbersShown > newNumLines)
|
||||||
|
|
Loading…
Reference in a new issue