diff --git a/builddate.js b/builddate.js index eaec69e..ff1da75 100644 --- a/builddate.js +++ b/builddate.js @@ -1 +1 @@ -var CONF_builddate="20250101-164553" +var CONF_builddate="20250101-192145" diff --git a/eendraadschema.js b/eendraadschema.js index 24d0b8d..ed7ee21 100644 --- a/eendraadschema.js +++ b/eendraadschema.js @@ -114,13 +114,14 @@ function svgTextWidth(input, fontsize, options) { if (options === void 0) { options = ''; } var div = document.createElement('div'); div.innerHTML = '' + input + ''; - var tryoutdiv; - if (document.getElementById("configsection").style.display === 'block') { - tryoutdiv = document.getElementById("configsection"); - } - else { - tryoutdiv = document.getElementById("right_col_inner"); - } + var tryoutdiv = document.body; + /*if (document.getElementById("configsection").style.display === 'block') { + tryoutdiv = document.getElementById("configsection") as HTMLElement; + } else if (document.getElementById("outerbox").style.display === 'block') { + tryoutdiv = document.getElementById("outerbox") as HTMLElement; + } else { + tryoutdiv = document.getElementById("right_col_inner") as HTMLElement; + }*/ tryoutdiv.appendChild(div); var width = div.children[0].children[0].getBBox().width; tryoutdiv.removeChild(div); diff --git a/src/general.ts b/src/general.ts index e928c4e..b35eda4 100644 --- a/src/general.ts +++ b/src/general.ts @@ -55,12 +55,15 @@ function svgTextWidth(input:String, fontsize:Number = 10, options:String = '') { const div = document.createElement('div'); div.innerHTML = '' + input + ''; - let tryoutdiv: HTMLElement; - if (document.getElementById("configsection").style.display === 'block') { + let tryoutdiv: HTMLElement = document.body; + + /*if (document.getElementById("configsection").style.display === 'block') { tryoutdiv = document.getElementById("configsection") as HTMLElement; + } else if (document.getElementById("outerbox").style.display === 'block') { + tryoutdiv = document.getElementById("outerbox") as HTMLElement; } else { tryoutdiv = document.getElementById("right_col_inner") as HTMLElement; - } + }*/ tryoutdiv.appendChild(div); const width = (div.children[0].children[0] as SVGGraphicsElement).getBBox().width;