Fix collapsing folders.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Jun 2009 22:35:18 +0000 (16:35 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Jun 2009 22:35:40 +0000 (16:35 -0600)
imp/js/src/DimpBase.js

index deebea0..fc79184 100644 (file)
@@ -1922,13 +1922,12 @@ var DimpBase = {
         // don't need to parse through them.
         var subs = (mode == 'exp')
             ? base.ancestors().slice(0, -2).reverse().findAll(function(n) { return n.hasClassName('subfolders'); })
-            : [ base ];
+            : [ base.next('.subfolders') ];
 
-        subs.each(function(s) {
-            if (s &&
-                (mode == 'tog' ||
-                 (mode == 'exp' && !s.visible()) ||
-                 (mode == 'col' && s.visible()))) {
+        subs.compact().each(function(s) {
+            if (mode == 'tog' ||
+                (mode == 'exp' && !s.visible()) ||
+                (mode == 'col' && s.visible())) {
                 s.previous().down().toggleClassName('exp').toggleClassName('col');
 
                 if (noeffect) {