10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +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
reloadGeoms()
await reloadGeoms()
reloadCustomFiles()
}
async function reloadGeoms(){
@ -150,6 +150,11 @@ draft: false
molecule:d.molecule
}
})))
processingIndicator.isActive = false
reloadSizeSelector()
}
function reloadSizeSelector() {
if (window.geoms && window.dats) {
const nHnums=window.geoms.map((g)=>{
return g.molecule.atoms.count((a)=>a.label!=="H")
})
@ -159,10 +164,14 @@ draft: false
$("#nHmax").attr("max",nHmax).val(nHmax)
const mols = uniq(window.geoms.map(g=>g.parseMetadata().molecule))
const shownHunknow=window.dats.some((d)=>!mols.includes(d.molecule))
const nHUnknowDiv = $("#cb_nHUnknow").parent()
if (shownHunknow) {
$("#cb_nHUnknow").parent().show()
nHUnknowDiv.show()
}
else{
nHUnknowDiv.hide()
}
}
processingIndicator.isActive = false
}
async function reloadCustomFiles() {
processingIndicator.isActive = true
@ -177,6 +186,7 @@ draft: false
}
}
processingIndicator.isActive = false
reloadSizeSelector()
reloadSelect("sets")
}
async function clearSelect(BeforeName = null) {