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:
parent
2a1c9520ee
commit
1fb7172f42
@ -139,7 +139,7 @@ draft: false
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
processingIndicator.isActive = false
|
processingIndicator.isActive = false
|
||||||
reloadGeoms()
|
await reloadGeoms()
|
||||||
reloadCustomFiles()
|
reloadCustomFiles()
|
||||||
}
|
}
|
||||||
async function reloadGeoms(){
|
async function reloadGeoms(){
|
||||||
@ -150,19 +150,28 @@ draft: false
|
|||||||
molecule:d.molecule
|
molecule:d.molecule
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
const nHnums=window.geoms.map((g)=>{
|
processingIndicator.isActive = false
|
||||||
return g.molecule.atoms.count((a)=>a.label!=="H")
|
reloadSizeSelector()
|
||||||
})
|
}
|
||||||
var nHmin = ss.min(nHnums)
|
function reloadSizeSelector() {
|
||||||
$("#nHmin").attr("min",nHmin).val(nHmin)
|
if (window.geoms && window.dats) {
|
||||||
var nHmax = ss.max(nHnums)
|
const nHnums=window.geoms.map((g)=>{
|
||||||
$("#nHmax").attr("max",nHmax).val(nHmax)
|
return g.molecule.atoms.count((a)=>a.label!=="H")
|
||||||
const mols = uniq(window.geoms.map(g=>g.parseMetadata().molecule))
|
})
|
||||||
const shownHunknow=window.dats.some((d)=>!mols.includes(d.molecule))
|
var nHmin = ss.min(nHnums)
|
||||||
if (shownHunknow) {
|
$("#nHmin").attr("min",nHmin).val(nHmin)
|
||||||
$("#cb_nHUnknow").parent().show()
|
var nHmax = ss.max(nHnums)
|
||||||
|
$("#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) {
|
||||||
|
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user