Don't toggle nodes with no children.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 03:43:12 +0000 (21:43 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 03:43:12 +0000 (21:43 -0600)
framework/Core/js/hordetree.js

index aba38e1..c72f2e5 100644 (file)
@@ -397,6 +397,10 @@ var Horde_Tree = Class.create({
         var icon, nodeToggle, toggle, children,
             node = this.nodes[nodeId];
 
+        if (!node.children) {
+            return;
+        }
+
         node.expanded = !node.expanded;
         if (children = $('nodeChildren_' + nodeId)) {
             children.setStyle({ display: node.expanded ? 'block' : 'none' });