From c7be4f9d2dbfa540eec0151d5891759facc94530 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 29 Jul 2021 02:37:58 -0400 Subject: [PATCH] ace2_inner: Move `sidedivinner` creation to ace.js --- src/static/js/ace.js | 4 ++++ src/static/js/ace2_inner.js | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) 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);