Commits

Shlomi Fish  committed a852309

.

  • Participants
  • Parent commits 162205c

Comments (0)

Files changed (1)

File common/js/tree.jquery.js

 
   /*
   Copyright 2012 Marco Braak
-  
+
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
-  
+
       http://www.apache.org/licenses/LICENSE-2.0
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
     /*
         Create tree from data.
-    
+
         Structure of data is:
         [
             {
 
     /*
         Add child.
-    
+
         tree.addChild(
             new Node('child1')
         );
 
     /*
         Add child at position. Index starts at 0.
-    
+
         tree.addChildAtPosition(
             new Node('abc'),
             1
 
     /*
         Remove child.
-    
+
         tree.removeChild(tree.children[0]);
     */
 
 
     /*
         Get child index.
-    
+
         var index = getChildIndex(node);
     */
 
 
     /*
         Does the tree have children?
-    
+
         if (tree.hasChildren()) {
             //
         }
 
     /*
         Iterate over all the nodes in the tree.
-    
+
         Calls callback with (node, level).
-    
+
         The callback must return true to continue the iteration on current node.
-    
+
         tree.iterate(
             function(node, level) {
                console.log(node.name);
-    
+
                // stop iteration after level 2
                return (level <= 2);
             }
 
     /*
         Move node relative to another node.
-    
+
         Argument position: Position.BEFORE, Position.AFTER or Position.Inside
-    
+
         // move node1 after node2
         tree.moveNode(node1, node2, Position.AFTER);
     */