Changes for page Treeview
Last modified by Ludovic Dubost on 2023/04/25 09:12
From version 18.1
edited by Ludovic Dubost
on 2010/11/03 01:23
on 2010/11/03 01:23
Change comment:
There is no comment for this version
To version 21.1
edited by Ludovic Dubost
on 2010/11/03 01:27
on 2010/11/03 01:27
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,7 +1,7 @@ 1 1 {{velocity}} 2 2 {{html clean=false}} 3 3 #set($rootpage = $xcontext.macro.params.page) 4 -#set($maxdepth = $xcontext.macro.params.maxdepth) 4 +#set($maxdepth = $util.parseInt($xcontext.macro.params.maxdepth)) 5 5 #set($selectlist = $util.arrayList) 6 6 #set($treelist = $util.arrayList) 7 7 #set($ok = $treelist.add({"id" : $rootpage, "value" : $rootpage, "parent" : "", "url" : $xwiki.getURL($rootpage), "expanded" : true})) ... ... @@ -71,6 +71,10 @@ 71 71 parent2 = nodes[parent]; 72 72 nodes[id] = new YAHOO.widget.TextNode(text, parent2, expanded); 73 73 nodes[id].href = url; 74 + if (expanded) 75 + nodes[id].expand() 76 + else 77 + nodes[id].collapse() 74 74 } 75 75 76 76 function treeInit${tviewid}() {