Don't need to cycle through the last 2 elements
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 10 Feb 2009 20:30:43 +0000 (13:30 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 10 Feb 2009 20:30:43 +0000 (13:30 -0700)
imp/js/src/DimpBase.js

index a875b7a..02dd435 100644 (file)
@@ -305,7 +305,9 @@ var DimpBase = {
         elt.addClassName('on');
 
         // Make sure all subfolders are expanded
-        elt.ancestors().find(function(n) {
+        // The last 2 elements of ancestors() are the BODY and HTML tags -
+        // don't need to parse through them.
+        elt.ancestors().slice(0, -2).find(function(n) {
             if (n.hasClassName('subfolders')) {
                 this._toggleSubFolder(n.id.substring(3), 'exp');
             } else {