diff options
author | st782s <statta@research.att.com> | 2017-05-04 07:48:42 -0400 |
---|---|---|
committer | st782s <statta@research.att.com> | 2017-05-04 12:28:17 -0400 |
commit | b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 (patch) | |
tree | e69cfa9b314a801bd187cf0145d1d4306436229c /ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js | |
parent | 39d1e62c84041831bfc52cca73b5ed5efaf57d27 (diff) |
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects
abstraction of components
Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js b/ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js deleted file mode 100644 index 58a80252..00000000 --- a/ecomp-portal-FE/client/bower_components/jqTree/static/example_data.js +++ /dev/null @@ -1,128 +0,0 @@ -var ExampleData = {}; - -ExampleData.example_data = [ - { - name: 'Saurischia', - id: 1, - children: [ - {name: 'Herrerasaurians', id: 2}, - { - name: 'Theropods', - id: 3, - children: [ - {name: 'Coelophysoids', id: 4}, - {name: 'Ceratosaurians', id: 5}, - {name: 'Spinosauroids', id: 6}, - {name: 'Carnosaurians', id: 7}, - { - name: 'Coelurosaurians', - id: 8, - children: [ - {name: 'Tyrannosauroids', id: 9}, - {name: 'Ornithomimosaurians', id: 10}, - {name: 'Therizinosauroids', id: 11}, - {name: 'Oviraptorosaurians', id: 12}, - {name: 'Dromaeosaurids', id: 13}, - {name: 'Troodontids', id: 14}, - {name: 'Avialans', id: 15} - ] - } - ] - }, - { - name: 'Sauropodomorphs', - id: 16, - children: [ - {name: 'Prosauropods', id: 17}, - { - name: 'Sauropods', - id: 18, - children: [ - {name: 'Diplodocoids', id: 19}, - { - name: 'Macronarians', - id: 20, - children: [ - {name: 'Brachiosaurids', id: 21}, - {name: 'Titanosaurians', id: 22} - ] - } - ] - } - ] - } - ] - }, - { - name: 'Ornithischians', - id: 23, - children: [ - {name: 'Heterodontosaurids', id: 24}, - { - name: 'Thyreophorans', - id: 25, - children: [ - {name: 'Ankylosaurians', id: 26}, - {name: 'Stegosaurians', id: 27} - ] - }, - { - name: 'Ornithopods', - id: 28, - children: [ - {name: 'Hadrosaurids', id: 29} - ] - }, - {name: 'Pachycephalosaurians', id: 30}, - {name: 'Ceratopsians', id: 31} - ] - } -]; - -ExampleData.getFirstLevelData = function(nodes) { - if (! nodes) { - nodes = ExampleData.example_data; - } - - var data = []; - - $.each(nodes, function() { - var node = { - name: this.name, - id: this.id - }; - - if (this.children) { - node.load_on_demand = true; - } - - data.push(node); - }); - - return data; -} - -ExampleData.getChildrenOfNode = function(node_id) { - var result = null; - - function iterate(nodes) { - $.each(nodes, function() { - if (result) { - return; - } - else { - if (this.id == node_id) { - result = this; - } - - if (this.children) { - iterate(this.children); - } - } - }); - } - - iterate(ExampleData.example_data); - - return ExampleData.getFirstLevelData(result.children); -} |