diff options
author | 2017-05-04 07:48:42 -0400 | |
---|---|---|
committer | 2017-05-04 12:28:17 -0400 | |
commit | b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 (patch) | |
tree | e69cfa9b314a801bd187cf0145d1d4306436229c /ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.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/src_test/utils_for_test.js')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.js | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.js b/ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.js deleted file mode 100644 index 3885ef51..00000000 --- a/ecomp-portal-FE/client/bower_components/jqTree/src_test/utils_for_test.js +++ /dev/null @@ -1,107 +0,0 @@ -/* -example data: - -node1 ----child1 ----child2 --node2 ----child3 -*/ - -var example_data = [ - { - label: 'node1', - id: 123, // extra data - int_property: 1, - str_property: '1', - children: [ - { label: 'child1', id: 125, int_property: 2 }, - { label: 'child2', id: 126 } - ] - }, - { - label: 'node2', - id: 124, - int_property: 3, - str_property: '3', - children: [ - { label: 'child3', id: 127 } - ] - } -]; - -/* -example data 2: - --main ----c1 ----c2 -*/ - -var example_data2 = [ - { - label: 'main', - children: [ - { label: 'c1' }, - { label: 'c2' } - ] - } -]; - -function formatNodes(nodes) { - var strings = $.map(nodes, function(node) { - return node.name; - }); - return strings.join(' '); -}; - -function isNodeClosed($node) { - return ( - ($node.is('li.jqtree-folder.jqtree-closed')) && - ($node.find('a:eq(0)').is('a.jqtree-toggler.jqtree-closed')) && - ($node.find('ul:eq(0)').is('ul')) - ); -} - -function isNodeOpen($node) { - return ( - ($node.is('li.jqtree-folder')) && - ($node.find('a:eq(0)').is('a.jqtree-toggler')) && - ($node.find('ul:eq(0)').is('ul')) && - (! $node.is('li.jqtree-folder.jqtree-closed')) && - (! $node.find('span:eq(0)').is('a.jqtree-toggler.jqtree-closed')) - ); -} - -function formatTitles($node) { - var titles = $node.find('.jqtree-title').map( - function(i, el) { - return $(el).text(); - } - ); - return titles.toArray().join(' '); -} - -function getTreeVariables() { - var JqTreeWidget = $('').tree('get_widget_class'); - - var node = JqTreeWidget.getModule('node'); - var util = JqTreeWidget.getModule('util'); - - return { - Node: node.Node, - Position: node.Position, - util: util - }; -} - - -module.exports = { - example_data: example_data, - example_data2: example_data2, - formatNodes: formatNodes, - formatTitles: formatTitles, - getTreeVariables: getTreeVariables, - isNodeClosed: isNodeClosed, - isNodeOpen: isNodeOpen -}; |