From 23071f9cb32e1783d8c0aa960a8407e9024876c9 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 15 Feb 2012 21:51:28 -0800 Subject: Tree Node - fix for applying tree child nodes array twice (and getting duplicates) --- js/components/treeview/tree-node.js | 2 ++ 1 file changed, 2 insertions(+) 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, { if(!object) { return; } + if(object[this.branchKey]) { + this.childNodes.length = 0; object[this.branchKey].forEach(function(node) { this.childNodes.push(node); }, this); -- cgit v1.2.3