Collapsibles for the embeddings dialog

Harmonization with the modifiers dialog
This commit is contained in:
JeLuF
2023-07-18 00:08:38 +02:00
parent 14c1d17632
commit 7debd2cd97
5 changed files with 111 additions and 21 deletions

View File

@ -129,6 +129,31 @@ function tryLoadOldCollapsibles() {
return null
}
function collapseAll(selector) {
const collapsibleElems = document.querySelectorAll(selector); // needs to have ";"
[...collapsibleElems].forEach((elem) => {
const isActive = elem.classList.contains("active")
if(isActive) {
elem?.click()
}
})
}
function expandAll(selector) {
const collapsibleElems = document.querySelectorAll(selector); // needs to have ";"
[...collapsibleElems].forEach((elem) => {
const isActive = elem.classList.contains("active")
if (!isActive) {
elem?.click()
}
})
}
function permute(arr) {
let permutations = []
let n = arr.length