From 820b400315299315c878edbfa9c3b0a3d98a480b Mon Sep 17 00:00:00 2001 From: nadrad Date: Sat, 18 Mar 2023 08:44:43 +0100 Subject: [PATCH] small fixes for the hiding feature --- h-m-m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/h-m-m b/h-m-m index 156d564..a1194f1 100755 --- a/h-m-m +++ b/h-m-m @@ -2296,7 +2296,8 @@ function change_active_node(&$mm, $x, $y) if ($x > 0) { - if ($node['is_leaf']) return; + if (count($node['visible_children'])==0) + return; // auto-unfold node on right move if ($node['collapsed'] ?? false) { @@ -2715,7 +2716,8 @@ function expand_all(&$mm) function collapse_siblings(&$mm, $id) { - if ($id <= $mm['root_id']) return; + if ($id <= $mm['root_id']) + return; $parent_id = $mm['nodes'][$id]['parent']; @@ -2729,7 +2731,8 @@ function collapse_siblings(&$mm, $id) function expand_siblings(&$mm, $id) { - if ($mm['nodes'][$id]['is_leaf']) return; + if ($mm['nodes'][$id]['is_leaf']) + return; $mm['nodes'][$id]['collapsed'] = false; foreach ($mm['nodes'][$id]['children'] as $cid)