#268 added wunderbaum 0.12.0

This commit is contained in:
Roland Gruber 2025-02-12 20:35:48 +01:00
parent 90c0d4e9aa
commit a010e943bc
4 changed files with 16 additions and 12 deletions

View file

@ -1656,7 +1656,7 @@ class TreeView {
* @return int result
*/
function compareNodeByIdAsDn($a, $b): int {
return strnatcasecmp(extractRDN(base64_decode($a['id'])), extractRDN(base64_decode($b['id'])));
return strnatcasecmp(extractRDN(base64_decode($a['key'])), extractRDN(base64_decode($b['key'])));
}
/**

View file

@ -948,6 +948,10 @@ i.wb-icon {
margin-right: 5px;
}
:root {
--wb-node-text-color: var(--lam-text-color-default) !important;
}
div.swal2-html-container {
overflow: visible;
}

View file

@ -2934,16 +2934,16 @@ window.lam.treeview.searchResults = function (event, tokenName, tokenValue, dn)
* @param tree tree object
* @param ids array of node IDs.
*/
window.lam.treeview.openInitial = function(tree, ids) {
window.lam.treeview.openInitial = async function (tree, ids) {
if (ids.length === 0) {
return;
}
const firstNodeId = ids.shift();
tree.open_node(firstNodeId, function() {
window.lam.treeview.openInitial(tree, ids);
});
if (ids.length === 0) {
tree.select_node(firstNodeId);
for (const id of ids) {
const node = tree.findKey(id);
if (node) {
await node.setExpanded();
await node.setActive();
}
}
}

View file

@ -129,10 +129,10 @@ function showTree(): void {
id: "ldap_tree",
debugLevel: 2,
source: "../misc/ajax.php?function=treeview&command=getRootNodes",
// Event handlers:
/*init: (e) => {
//window.lam.treeview.openInitial(tree, ' . $openInitialJsArray . ');
},*/
init: (e) => {
tree.expandAll(true, {depth: 1, });
window.lam.treeview.openInitial(tree, ' . $openInitialJsArray . ');
},
lazyLoad: function(e) {
return {url: "../misc/ajax.php?function=treeview&command=getNodes&dn=" + e.node.key};
},