diff --git a/content/multipledataset.html b/content/multipledataset.html index 3c064d71..c60ffd45 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -21,24 +21,25 @@ draft: false window.Cite = require('citation-js'); $('#form_dat input[type=radio]').on('change', async function(event) { processingIndicator.isActive=true - document.getElementById("Geom_th").hidden=true - document.getElementById("GSGeom_th").hidden=true - document.getElementById("ESGeom_th").hidden=true + $("#Geom_th,#GSGeom_th,#ESGeom_th").each(function(){ + $(this).attr("hidden",true) + }) var result = $(this).val(); var proms=[]; switch (result) { case "abs": proms=getAbsFilesName().map((f) => AbsDataFile.loadAsync(f)); - document.getElementById("Geom_th").hidden=false + $("#Geom_th").attr("hidden",false) break; case "fluo": proms=getFluoFilesName().map((f) => FluoDataFile.loadAsync(f)); - document.getElementById("Geom_th").hidden=false + $("#Geom_th").attr("hidden",false) break; case "zpe": proms=getZPEFilesName().map((f) => ZPEDataFile.loadAsync(f)); - document.getElementById("GSGeom_th").hidden=false - document.getElementById("ESGeom_th").hidden=false + $("#GSGeom_th,#ESGeom_th").each(function(){ + $(this).attr("hidden",false) + }) break; } window.dats=await Promise.all(proms) @@ -48,16 +49,14 @@ draft: false }) } function reloadFileSelector(){ - const fsel=document.getElementById("customFiles_input") - fsel.value="" - fsel.disabled=false + $("#customFiles_input").attr("value","").attr("disabled",false) } async function reloadSelect(){ processingIndicator.isActive=true radioval=$('#form_dat > input[name=datatype]:checked').val(); - for(file of Array.from(document.getElementById("customFiles_input").files)) - { + const files=$("#customFiles_input")[0].files + for(file of [...files]) { switch (radioval) { case "abs": var dat=await AbsDataFile.loadAsync(file) @@ -78,11 +77,10 @@ draft: false $(this).find('option[value!=""]').remove() const vals=uniq(window.dats.map((d)=>{return d[$(this).attr("name")]})) for (const val of vals){ - op=document.createElement("option") - op.value=JSON.stringify(val) - op.innerText=val.toString() - $(this).append(op) - } + $("