From b7e410b54fa453bda429f3848474eb4676d9db26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Sat, 28 Sep 2019 16:04:36 +0200 Subject: [PATCH 1/2] Fix error of datafile type --- content/multipledataset.html | 40 ++++++++++++++---------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/content/multipledataset.html b/content/multipledataset.html index 414dbf4b..ec742d8f 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -16,19 +16,19 @@ draft: false window.onload= async ()=>{ $('#form input[type=radio]').on('change', async function(event) { var result = $(this).val(); - var files=[]; + var proms=[]; switch (result) { case "abs": - files=getAbsFilesName(); + proms==getAbsFilesName().map((f) => AbsDataFile.loadAsync(f)); break; case "fluo": - files=getFluoFilesName(); + proms=getFluoFilesName().map((f) => FluoDataFile.loadAsync(f)); break; case "zpe": - files=getZPEFilesName(); + proms=getZPEFilesName().map((f) => ZPEDataFile.loadAsync(f)); break; } - window.dats=await Promise.all(files.map((f) => ZPEDataFile.loadAsync(f))) + window.dats=await Promise.all(proms) reloadSelect() reloadContent() }) @@ -47,16 +47,14 @@ draft: false } function reloadContent(){ var filt=window.dats - $('#dat_table > thead > tr > th > select').each(function(){ - const prop=$(this).data("prop") - const value=$(this).val() + $('#form > select').each(function(){ + const prop=$(this).attr("name") + const values=$(this).val() filt=filt.filter((d)=>{ - if(value==""){ - return true - } - else { - return d[prop]==value + if(typeof values=="undefined" || values==null){ + return false } + return values.map((v)=>JSON.stringify(v)).includes(JSON.stringify(d[prop])) }) }) var tb=document.getElementById("table_b"); @@ -84,21 +82,13 @@ draft: false
- + - + - + - +
From a2009896d3c2cede25122355885d2f835935e0c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Sat, 28 Sep 2019 16:15:33 +0200 Subject: [PATCH 2/2] Fix == --- content/multipledataset.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/multipledataset.html b/content/multipledataset.html index ec742d8f..c5e6c3f2 100644 --- a/content/multipledataset.html +++ b/content/multipledataset.html @@ -19,7 +19,7 @@ draft: false var proms=[]; switch (result) { case "abs": - proms==getAbsFilesName().map((f) => AbsDataFile.loadAsync(f)); + proms=getAbsFilesName().map((f) => AbsDataFile.loadAsync(f)); break; case "fluo": proms=getFluoFilesName().map((f) => FluoDataFile.loadAsync(f));