mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge pull request #1716 from ether/only-redraw-existing-lines
only try to redraw the line height of lines that exist..
This commit is contained in:
commit
12bc98af7e
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,17 +5214,23 @@ 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
|
||||||
var h = (b.clientHeight || b.offsetHeight);
|
if(b){
|
||||||
|
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);
|
||||||
b = b.nextSibling;
|
if(b){
|
||||||
|
b = b.nextSibling;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
container.appendChild(fragment);
|
container.appendChild(fragment);
|
||||||
|
|
Loading…
Reference in a new issue