mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
ace2_inner: Add line number divs directly, not via fragment
There's no layout thrashing so the fragment doesn't provide any benefit.
This commit is contained in:
parent
e1a024847c
commit
27363bf729
1 changed files with 1 additions and 4 deletions
|
@ -3604,8 +3604,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newNumLines !== lineNumbersShown) {
|
if (newNumLines !== lineNumbersShown) {
|
||||||
const fragment = outerDoc.createDocumentFragment();
|
|
||||||
|
|
||||||
// Create missing line and apply height
|
// Create missing line and apply height
|
||||||
while (lineNumbersShown < newNumLines) {
|
while (lineNumbersShown < newNumLines) {
|
||||||
lineNumbersShown++;
|
lineNumbersShown++;
|
||||||
|
@ -3615,10 +3613,9 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
div.style.lineHeight = `${lineHeights[currentLine]}px`;
|
div.style.lineHeight = `${lineHeights[currentLine]}px`;
|
||||||
}
|
}
|
||||||
$(div).append($(`<span class='line-number'>${String(lineNumbersShown)}</span>`));
|
$(div).append($(`<span class='line-number'>${String(lineNumbersShown)}</span>`));
|
||||||
fragment.appendChild(div);
|
sideDivInner.appendChild(div);
|
||||||
currentLine++;
|
currentLine++;
|
||||||
}
|
}
|
||||||
sideDivInner.appendChild(fragment);
|
|
||||||
|
|
||||||
// Remove extra lines
|
// Remove extra lines
|
||||||
while (lineNumbersShown > newNumLines) {
|
while (lineNumbersShown > newNumLines) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue