diff --git a/src/static/js/ace.js b/src/static/js/ace.js index 9339e46fd..efb38077f 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -229,6 +229,10 @@ const Ace2Editor = function () { sideDiv.id = 'sidediv'; sideDiv.classList.add('sidediv'); outerDocument.body.appendChild(sideDiv); + const sideDivInner = outerDocument.createElement('div'); + sideDivInner.id = 'sidedivinner'; + sideDivInner.classList.add('sidedivinner'); + sideDiv.appendChild(sideDivInner); const lineMetricsDiv = outerDocument.createElement('div'); lineMetricsDiv.id = 'linemetricsdiv'; lineMetricsDiv.appendChild(outerDocument.createTextNode('x')); diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 3b83591b6..b25f55672 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -64,10 +64,7 @@ function Ace2Inner(editorInfo, cssManagers) { const outerDoc = outerWin.document; const sideDiv = outerDoc.getElementById('sidediv'); const lineMetricsDiv = outerDoc.getElementById('linemetricsdiv'); - const sideDivInner = outerDoc.createElement('div'); - sideDivInner.id = 'sidedivinner'; - sideDivInner.classList.add('sidedivinner'); - sideDiv.appendChild(sideDivInner); + const sideDivInner = outerDoc.getElementById('sidedivinner'); (() => { const lineDiv = outerDoc.createElement('div'); sideDivInner.appendChild(lineDiv);