nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / jqTree / static / documentation.js
1 $(function() {
2     var $menu = $('#menu');
3     var $body = $('body');
4     var $h1 = $('#jqtree h1');
5
6     // title
7     $h1.html("<span class=\"first\">jq</span><span class=\"second\">Tree</span>");
8
9     // menu
10     $menu.affix({
11         offset: {
12             top: $menu.offset().top,
13             bottom: 0
14         }
15     });
16
17     $body.scrollspy({
18         target: '#menu'
19     });
20     var scrollspy = $body.data('bs.scrollspy');
21
22     // If no menu item is active, then activate first item
23     if (! scrollspy.activeTarget) {
24         scrollspy.activate('#general');
25     }
26
27     // demo tree
28     var data = [
29         {
30             label: 'node1', id: 1,
31             children: [
32                 { label: 'child1', id: 2 },
33                 { label: 'child2', id: 3 }
34             ]
35         },
36         {
37             label: 'node2', id: 4,
38             children: [
39                 { label: 'child3', id: 5 }
40             ]
41         }
42     ];
43
44     var $tree1 = $('#tree1');
45
46     $tree1.tree({
47         data: data,
48         autoOpen: true,
49         dragAndDrop: true
50     });
51 });