ace2_inner: Build `sidedivinner` programmatically
parent
b80295c228
commit
15b1d4cb75
|
@ -64,11 +64,17 @@ function Ace2Inner(editorInfo, cssManagers) {
|
||||||
const outerDoc = outerWin.document;
|
const outerDoc = outerWin.document;
|
||||||
const sideDiv = outerDoc.getElementById('sidediv');
|
const sideDiv = outerDoc.getElementById('sidediv');
|
||||||
const lineMetricsDiv = outerDoc.getElementById('linemetricsdiv');
|
const lineMetricsDiv = outerDoc.getElementById('linemetricsdiv');
|
||||||
const sideDivInner = (() => {
|
const sideDivInner = outerDoc.createElement('div');
|
||||||
const htmlOpen = '<div id="sidedivinner" class="sidedivinner"><div><span class="line-number">1';
|
sideDivInner.id = 'sidedivinner';
|
||||||
const htmlClose = '</span></div></div>';
|
sideDivInner.classList.add('sidedivinner');
|
||||||
sideDiv.innerHTML = `${htmlOpen}${htmlClose}`;
|
sideDiv.appendChild(sideDivInner);
|
||||||
return outerDoc.getElementById('sidedivinner');
|
(() => {
|
||||||
|
const lineDiv = outerDoc.createElement('div');
|
||||||
|
sideDivInner.appendChild(lineDiv);
|
||||||
|
const lineSpan = outerDoc.createElement('span');
|
||||||
|
lineSpan.classList.add('line-number');
|
||||||
|
lineSpan.appendChild(outerDoc.createTextNode('1'));
|
||||||
|
lineDiv.appendChild(lineSpan);
|
||||||
})();
|
})();
|
||||||
let lineNumbersShown = 1;
|
let lineNumbersShown = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue