Nextrek
Diff Revisions
743
vs
745
for /legal-map/js/tree.js
|
@@ -19,15 +19,18 @@ |
19 |
19 |
|
htmlToAppend += 'cat="'+node.attr("cat")+'" '; |
20 |
20 |
|
htmlToAppend += 'leaf="'+((nodes[i].is_leaf) ? 1 : 0)+'" '; |
21 |
21 |
|
htmlToAppend += 'class="level-node-'+nodes[i].level+' '; |
|
22 |
+ |
htmlToAppend += (i==nodes.length-1) ? 'last-node ' : ""; |
22 |
23 |
|
htmlToAppend += 'cat-node-'+node.attr("cat")+'">'; |
23 |
|
- |
htmlToAppend += "<div class='node-container'>"+nodes[i].ramodescrizione+"</div></li>"; |
24 |
|
- |
htmlToAppend += (!nodes[i].is_leaf) ? "<ul id='list-id-"+nodes[i].id+"'></ul>" : ""; |
|
24 |
+ |
htmlToAppend += "<div class='node-container'>"+nodes[i].ramodescrizione+"</div>"; |
|
25 |
+ |
htmlToAppend += (!nodes[i].is_leaf) ? "<ul id='list-id-"+nodes[i].id+"' class='level-list-"+(level+1)+"' style='display:none;'></ul></li>" : ""; |
25 |
26 |
|
|
26 |
27 |
|
//node.parent().append(htmlToAppend); |
27 |
28 |
|
$("#list-id-"+node.attr("node-id")).append(htmlToAppend); |
28 |
29 |
|
|
29 |
30 |
|
} |
30 |
31 |
|
|
|
32 |
+ |
$("#list-id-"+node.attr("node-id")).show(); |
|
33 |
+ |
|
31 |
34 |
|
node.parent().find(".level-node-"+level+"[leaf='0']").click(function() { |
32 |
35 |
|
openNode($(this), level+1); |
33 |
36 |
|
}); |
|
@@ -74,7 +77,7 @@ |
74 |
77 |
|
htmlToAppend += 'leaf="'+((nodes[i].is_leaf) ? 1 : 0)+'" '; |
75 |
78 |
|
htmlToAppend += 'class="level-node-1 cat-node-'+(i+1)+'">'; |
76 |
79 |
|
htmlToAppend += nodes[i].ramodescrizione+"</li>"; |
77 |
|
- |
htmlToAppend += (!nodes[i].is_leaf) ? "<ul id='list-id-"+nodes[i].id+"'></ul>" : ""; |
|
80 |
+ |
htmlToAppend += (!nodes[i].is_leaf) ? "<ul id='list-id-"+nodes[i].id+"' class='level-list-2' style='display:none;'></ul>" : ""; |
78 |
81 |
|
|
79 |
82 |
|
$("#treeContainer").append(htmlToAppend); |
80 |
83 |
|
} |