aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-16 11:10:00 -0800
committerValerio Virgillito2012-02-16 11:10:00 -0800
commit9aed3035ed7b0807ec198327ddd8305596331491 (patch)
treef95b0fa1ca064dd3b8c1d6c5637a4b5f8897f985
parentd52aca45e0357b5597e13d9b74998abb75fabea5 (diff)
parent966f0adaf1d4b7f2dd5a6e31643df58bff713884 (diff)
downloadninja-9aed3035ed7b0807ec198327ddd8305596331491.tar.gz
Merge pull request #43 from ericguzman/TreeComponents
Tree components
-rw-r--r--js/components/controllers/tree-controller.js5
-rw-r--r--js/components/treeview/ninja-branch.reel/ninja-branch.css2
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.css1
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.js3
-rw-r--r--js/components/treeview/tree-node.js2
5 files changed, 8 insertions, 5 deletions
diff --git a/js/components/controllers/tree-controller.js b/js/components/controllers/tree-controller.js
index 03ef7b9e..1e9222fd 100644
--- a/js/components/controllers/tree-controller.js
+++ b/js/components/controllers/tree-controller.js
@@ -28,7 +28,7 @@ var TreeController = exports.TreeController = Montage.create(ObjectController, /
28 }, 28 },
29 29
30 branchKey : { 30 branchKey : {
31 value: 'children' 31 value: null
32 }, 32 },
33 33
34 _root : { 34 _root : {
@@ -98,7 +98,8 @@ var TreeController = exports.TreeController = Montage.create(ObjectController, /
98 }, 98 },
99 99
100 branchControllers: { 100 branchControllers: {
101 value: [] 101 value: [],
102 distinct: true
102 }, 103 },
103 104
104 addBranchController : { 105 addBranchController : {
diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.css b/js/components/treeview/ninja-branch.reel/ninja-branch.css
index d8c212e8..a3a9350e 100644
--- a/js/components/treeview/ninja-branch.reel/ninja-branch.css
+++ b/js/components/treeview/ninja-branch.reel/ninja-branch.css
@@ -26,7 +26,7 @@
26 cursor: pointer; 26 cursor: pointer;
27 font-weight: bold; 27 font-weight: bold;
28 padding: 3px 0 4px; 28 padding: 3px 0 4px;
29 text-shadow: 1px 1px 0 #000; 29 text-shadow: 1px 1px 1px #000;
30} 30}
31 31
32/* First Level */ 32/* First Level */
diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
index 085b11e0..fedc1d9d 100644
--- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
+++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
@@ -19,7 +19,6 @@
19/* Second level */ 19/* Second level */
20.branch .branch .leaf-label { 20.branch .branch .leaf-label {
21 background-position: 25px center; 21 background-position: 25px center;
22 box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2);
23 color: #FFF; 22 color: #FFF;
24 padding-left: 45px; 23 padding-left: 45px;
25} 24}
diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js
index c6416693..1bfe66a4 100644
--- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.js
+++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.js
@@ -63,7 +63,8 @@ exports.Leaf = Montage.create(TreeNode, {
63 'dblclick' : 'handleDblclick', 63 'dblclick' : 'handleDblclick',
64 'dragstart' : 'handleDragStart', 64 'dragstart' : 'handleDragStart',
65 'dragend' : 'handleDragEnd' 65 'dragend' : 'handleDragEnd'
66 } 66 },
67 distinct: true
67 } 68 }
68 69
69 70
diff --git a/js/components/treeview/tree-node.js b/js/components/treeview/tree-node.js
index 689fc233..d7b864b5 100644
--- a/js/components/treeview/tree-node.js
+++ b/js/components/treeview/tree-node.js
@@ -44,7 +44,9 @@ exports.TreeNode = Montage.create(Component, {
44 if(!object) { 44 if(!object) {
45 return; 45 return;
46 } 46 }
47
47 if(object[this.branchKey]) { 48 if(object[this.branchKey]) {
49 this.childNodes.length = 0;
48 object[this.branchKey].forEach(function(node) { 50 object[this.branchKey].forEach(function(node) {
49 this.childNodes.push(node); 51 this.childNodes.push(node);
50 }, this); 52 }, this);