diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 42082f4ab..8467dd85a 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -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 = '
1'; const htmlClose = '
'; lineNumbersShown = 1; sideDiv.innerHTML = `${htmlOpen}${htmlClose}`; - sideDivInner = outerWin.document.getElementById('sidedivinner'); - }; - - initLineNumbers(); + return outerDoc.getElementById('sidedivinner'); + })(); const scroll = Scroll.init(outerWin);