ace2_inner: Replace `initLineNumbers()` with an IIFE

pull/5153/head
Richard Hansen 2021-07-29 02:16:13 -04:00
parent b5bfff43cf
commit 7a8edc816b
1 changed files with 3 additions and 7 deletions

View File

@ -65,17 +65,13 @@ function Ace2Inner(editorInfo, cssManagers) {
const sideDiv = outerDoc.getElementById('sidediv');
const lineMetricsDiv = outerDoc.getElementById('linemetricsdiv');
let lineNumbersShown;
let sideDivInner;
const initLineNumbers = () => {
const sideDivInner = (() => {
const htmlOpen = '<div id="sidedivinner" class="sidedivinner"><div><span class="line-number">1';
const htmlClose = '</span></div></div>';
lineNumbersShown = 1;
sideDiv.innerHTML = `${htmlOpen}${htmlClose}`;
sideDivInner = outerWin.document.getElementById('sidedivinner');
};
initLineNumbers();
return outerDoc.getElementById('sidedivinner');
})();
const scroll = Scroll.init(outerWin);