Fix javascript tree node toggling.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Aug 2010 20:40:12 +0000 (14:40 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Aug 2010 20:40:12 +0000 (14:40 -0600)
horde/js/hordetree.js

index 8509312..cc4be0f 100644 (file)
@@ -356,10 +356,10 @@ var Horde_Tree = Class.create({
         if (icon = $('nodeIcon_' + nodeId)) {
             // Image.
             if (node.icon) {
-                src.writeAttribute('src', (node.expanded && node.iconopen) ? node.iconopen : node.icon);
+                icon.writeAttribute('src', (node.expanded && node.iconopen) ? node.iconopen : node.icon);
             } else {
                 // Use standard icon set.
-                src.writeAttribute('src', node.expanded ? this.opts.imgFolderOpen : this.opts.imgFolder);
+                icon.writeAttribute('src', node.expanded ? this.opts.imgFolderOpen : this.opts.imgFolder);
             }
         }
 
@@ -369,7 +369,7 @@ var Horde_Tree = Class.create({
         }
 
         if (toggle = $('nodeToggle_' + nodeId)) {
-            toggle.writeAttribute('src', this._getNodeToggle(nodeId));
+            toggle.writeAttribute('class', 'treeToggle treeImg').addClassName('treeImg' + this._getNodeToggle(nodeId));
         }
 
         this.saveState(nodeId, node.expanded)