From a010e943bc697d1fe02751d5b7fdd22fef9ea24c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 12 Feb 2025 20:35:48 +0100 Subject: [PATCH] #268 added wunderbaum 0.12.0 --- lam/lib/treeview.inc | 2 +- lam/style/500_layout.css | 4 ++++ lam/templates/lib/500_lam.js | 14 +++++++------- lam/templates/tools/treeView.php | 8 ++++---- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lam/lib/treeview.inc b/lam/lib/treeview.inc index 040be2e10..ec5661b07 100644 --- a/lam/lib/treeview.inc +++ b/lam/lib/treeview.inc @@ -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']))); } /** diff --git a/lam/style/500_layout.css b/lam/style/500_layout.css index 0b94c6a14..8b0f5d28f 100644 --- a/lam/style/500_layout.css +++ b/lam/style/500_layout.css @@ -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; } diff --git a/lam/templates/lib/500_lam.js b/lam/templates/lib/500_lam.js index 1b6070be0..8024577e8 100644 --- a/lam/templates/lib/500_lam.js +++ b/lam/templates/lib/500_lam.js @@ -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(); + } } } diff --git a/lam/templates/tools/treeView.php b/lam/templates/tools/treeView.php index 7757fc293..a3a26e84a 100644 --- a/lam/templates/tools/treeView.php +++ b/lam/templates/tools/treeView.php @@ -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}; },