mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
ace2_inner: Simplify iteration over line number divs
This commit is contained in:
parent
b238d9610a
commit
3237f8d123
1 changed files with 4 additions and 9 deletions
|
@ -3603,15 +3603,10 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
}
|
||||
}
|
||||
|
||||
let sidebarLine = sideDivInner.firstChild;
|
||||
currentLine = 0;
|
||||
while (sidebarLine && currentLine <= sideDivInner.children.length) {
|
||||
if (lineOffsets[currentLine] != null) {
|
||||
sidebarLine.style.height = `${lineOffsets[currentLine]}px`;
|
||||
sidebarLine.style.lineHeight = `${lineHeights[currentLine]}px`;
|
||||
}
|
||||
sidebarLine = sidebarLine.nextSibling;
|
||||
currentLine++;
|
||||
for (const [i, sideDivLine] of Array.prototype.entries.call(sideDivInner.children)) {
|
||||
if (lineOffsets[i] == null) continue;
|
||||
sideDivLine.style.height = `${lineOffsets[i]}px`;
|
||||
sideDivLine.style.lineHeight = `${lineHeights[i]}px`;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue