10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 13:13:55 +01:00

dissociate Method and basis selector

This commit is contained in:
Mickaël Véril 2020-01-13 14:29:48 +01:00
parent e4bc15babe
commit cf683fb59d

View File

@ -120,10 +120,22 @@ draft: false
$(this).empty() $(this).empty()
}) })
$('#form_dat > fieldset > div > select').each(async function () { $('#form_dat > fieldset > div > select').each(async function () {
const vals = uniq(window.dats.map((d) => { return d[$(this).attr("name")] })) const vals = uniq(window.dats.map((d) => {
switch ($(this).attr("name")) {
case "method":
return d.method.name
break;
case "basis":
return d.method.basis
default:
return d[$(this).attr("name")]
break;
}
}))
var sets = await getSets() var sets = await getSets()
for (const val of vals) { for (const val of vals) {
var op = $("<option/>", { if(val!==null) {
var op = $("<option/>", {
value: JSON.stringify(val) value: JSON.stringify(val)
}) })
if ($(this).attr("name") == "DOI") { if ($(this).attr("name") == "DOI") {
@ -142,6 +154,7 @@ draft: false
$(op).text(val.toString()) $(op).text(val.toString())
} }
op.appendTo(this) op.appendTo(this)
}
} }
}) })
$('#form_dat > input[type="submit"').prop('disabled', false); $('#form_dat > input[type="submit"').prop('disabled', false);
@ -267,7 +280,20 @@ draft: false
if (typeof values == "undefined" || values == null) { if (typeof values == "undefined" || values == null) {
return false return false
} }
return values.includes(JSON.stringify(d[prop])) var val=null
switch (prop) {
case "method":
val=d.method.name
break;
case "basis":
val=d.method.basis
break;
default:
val=d[prop]
break;
}
return values.includes(JSON.stringify(val))
delete(val)
}) })
}) })
await window.doiCache.addRange(window.filtData.map((d) => d.DOI.string)) await window.doiCache.addRange(window.filtData.map((d) => d.DOI.string))
@ -433,6 +459,10 @@ draft: false
<label for="method_select">Method</label> <label for="method_select">Method</label>
<select multiple id="method_select" name="method"></select> <select multiple id="method_select" name="method"></select>
</div> </div>
<div>
<label for="basis_select">Basis</label>
<select multiple id="basis_select" name="basis"></select>
</div>
<div> <div>
<label for="DOI_select">Publication</label> <label for="DOI_select">Publication</label>
<select multiple id="DOI_select" name="DOI"></select> <select multiple id="DOI_select" name="DOI"></select>