10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 22:03:49 +01:00

Reload size selector when needed

This commit is contained in:
Mickaël Véril 2020-09-29 12:13:00 +02:00
parent 2a1c9520ee
commit 1fb7172f42

View File

@ -139,7 +139,7 @@ draft: false
} }
}) })
processingIndicator.isActive = false processingIndicator.isActive = false
reloadGeoms() await reloadGeoms()
reloadCustomFiles() reloadCustomFiles()
} }
async function reloadGeoms(){ async function reloadGeoms(){
@ -150,6 +150,11 @@ draft: false
molecule:d.molecule molecule:d.molecule
} }
}))) })))
processingIndicator.isActive = false
reloadSizeSelector()
}
function reloadSizeSelector() {
if (window.geoms && window.dats) {
const nHnums=window.geoms.map((g)=>{ const nHnums=window.geoms.map((g)=>{
return g.molecule.atoms.count((a)=>a.label!=="H") return g.molecule.atoms.count((a)=>a.label!=="H")
}) })
@ -159,10 +164,14 @@ draft: false
$("#nHmax").attr("max",nHmax).val(nHmax) $("#nHmax").attr("max",nHmax).val(nHmax)
const mols = uniq(window.geoms.map(g=>g.parseMetadata().molecule)) const mols = uniq(window.geoms.map(g=>g.parseMetadata().molecule))
const shownHunknow=window.dats.some((d)=>!mols.includes(d.molecule)) const shownHunknow=window.dats.some((d)=>!mols.includes(d.molecule))
const nHUnknowDiv = $("#cb_nHUnknow").parent()
if (shownHunknow) { if (shownHunknow) {
$("#cb_nHUnknow").parent().show() nHUnknowDiv.show()
}
else{
nHUnknowDiv.hide()
}
} }
processingIndicator.isActive = false
} }
async function reloadCustomFiles() { async function reloadCustomFiles() {
processingIndicator.isActive = true processingIndicator.isActive = true
@ -177,6 +186,7 @@ draft: false
} }
} }
processingIndicator.isActive = false processingIndicator.isActive = false
reloadSizeSelector()
reloadSelect("sets") reloadSelect("sets")
} }
async function clearSelect(BeforeName = null) { async function clearSelect(BeforeName = null) {