mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-08 03:52:12 +02:00
Collapse children on right move
This commit is contained in:
parent
8b2d68d8a2
commit
36eea814f8
11
h-m-m
11
h-m-m
|
@ -1636,7 +1636,6 @@ function export_html(&$mm)
|
||||||
|
|
||||||
message($mm, 'Exported as '.$mm['filename'].'.html');
|
message($mm, 'Exported as '.$mm['filename'].'.html');
|
||||||
copy_to_clipboard($mm, $mm['filename'].'.html');
|
copy_to_clipboard($mm, $mm['filename'].'.html');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1664,7 +1663,7 @@ function export_html_node(&$mm, $parent_id)
|
||||||
$output =
|
$output =
|
||||||
"<details>"
|
"<details>"
|
||||||
."<summary>"
|
."<summary>"
|
||||||
.$mm['nodes'][$parent_id]['title']
|
.$mm['nodes'][$parent_id]['title'] . ' (' . count($mm['nodes'][$parent_id]['children']) . ')'
|
||||||
."</summary>";
|
."</summary>";
|
||||||
|
|
||||||
foreach ($mm['nodes'][$parent_id]['children'] as $cid)
|
foreach ($mm['nodes'][$parent_id]['children'] as $cid)
|
||||||
|
@ -1837,7 +1836,13 @@ function change_active_node(&$mm, $direction)
|
||||||
|
|
||||||
if ($direction==move_right)
|
if ($direction==move_right)
|
||||||
{
|
{
|
||||||
if ($node['is_leaf'] || ($node['collapsed'] ?? false) ) return;
|
if ($node['is_leaf']) return;
|
||||||
|
|
||||||
|
// auto-unfold node on right move
|
||||||
|
if ($node['collapsed'] ?? false) {
|
||||||
|
toggle($mm);
|
||||||
|
$node = $mm['nodes'][ $mm['active_node'] ];
|
||||||
|
}
|
||||||
|
|
||||||
$distance = [];
|
$distance = [];
|
||||||
foreach ($node['children'] as $cid)
|
foreach ($node['children'] as $cid)
|
||||||
|
|
Loading…
Reference in a new issue