mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01: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) {
|
||||
const fragment = outerDoc.createDocumentFragment();
|
||||
|
||||
// Create missing line and apply height
|
||||
while (lineNumbersShown < newNumLines) {
|
||||
lineNumbersShown++;
|
||||
|
@ -3615,10 +3613,9 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
div.style.lineHeight = `${lineHeights[currentLine]}px`;
|
||||
}
|
||||
$(div).append($(`<span class='line-number'>${String(lineNumbersShown)}</span>`));
|
||||
fragment.appendChild(div);
|
||||
sideDivInner.appendChild(div);
|
||||
currentLine++;
|
||||
}
|
||||
sideDivInner.appendChild(fragment);
|
||||
|
||||
// Remove extra lines
|
||||
while (lineNumbersShown > newNumLines) {
|
||||
|
|
Loading…
Reference in a new issue