From a5886352fef73091cbc96f558024c904cc4bcc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Tue, 31 Mar 2020 14:24:01 +0200 Subject: [PATCH] Fix bug when excitation type is empty --- content/multipledataset.html | 5 ++++- static/js/data.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/content/multipledataset.html b/content/multipledataset.html index 4454530e..59cd70be 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -422,7 +422,10 @@ draft: false if (ex[3].Value == VertExcitationKinds.Fluorescence.Value) { Vertkindtext = String.raw`[\mathrm{F}]` } - $("", { scope: "rowgroup" }).text(String.raw`${LatexInline[0]}${ex[0].toLaTeX()} \rightarrow ${ex[1].toLaTeX()} ${Vertkindtext}(${ex[2].description.string}) ${LatexInline[1]}`).appendTo(tr) + if(ex[2].description.string){ + desctex="("+ex[2].description.string+")" + } + $("", { scope: "rowgroup" }).text(String.raw`${LatexInline[0]}${ex[0].toLaTeX()} \rightarrow ${ex[1].toLaTeX()} ${Vertkindtext} ${desctex} ${LatexInline[1]}`).appendTo(tr) var entries = Array.from(exdat.entries()) for (const method of sortedMethods) { td = $("").addClass("NumberCell") diff --git a/static/js/data.js b/static/js/data.js index aaa1d7fa..e02acc8a 100644 --- a/static/js/data.js +++ b/static/js/data.js @@ -145,7 +145,7 @@ class excitationBase { this.initial = initial; this.final = final this.type = new excitationType(0, new description(type,true)) - if (type !== "") { + if (type) { const tys = type.split(";") const arrow = String.raw`\rightarrow` for (const ty of tys) { @@ -277,6 +277,9 @@ class dataFileBase { var end = new state(parseInt(vals[3], 10), parseInt(vals[4],10), vals[5]); var hasType = vals.length >= 7 && isNaN(vals[6]) var type = ((vals.length >= 7 && hasType) ? vals[6] : null) + if (type==="_") { + type=null + } if (type) { const m = type.match(/^\(([^\)]*)\)$/) if (m) {