fix bug 658534, fail to expand folder pane items, a=standard8
authorDavid Bienvenu <bienvenu@nventure.com>
Tue, 26 Jul 2011 13:54:56 -0700
changeset 8309 808d304bffad6e8ba404365dadd72ccb617819cc
parent 8308 9315a92a8dc24aeaaac8466a3be770e617492232
child 8310 395d2c74f7b052716f667688b9f896842d8a2212
push idunknown
push userunknown
push dateunknown
reviewersstandard8
bugs658534
fix bug 658534, fail to expand folder pane items, a=standard8
mail/base/content/folderPane.js
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -868,37 +868,37 @@ let gFolderTreeView = {
         this._tree.rowCountChanged(aIndex + 1, (-1) * count);
         this._tree.invalidateRow(aIndex);
       }
     } else {
       // We're opening the container.  Add the children to our map
 
       // Note that these children may have been open when we were last closed,
       // and if they are, we also have to add those grandchildren to the map
-      let tree = this;
       let oldCount = this._rowMap.length;
-      function recursivelyAddToMap(aChild, aNewIndex) {
+      function recursivelyAddToMap(aChild, aNewIndex, tree) {
         // When we add sub-children, we're going to need to increase our index
         // for the next add item at our own level
         let count = 0;
         if (aChild.children.length && aChild.open) {
           for (let [i, child] in Iterator(tree._rowMap[aNewIndex].children)) {
             count++;
             var index = Number(aNewIndex) + Number(i) + 1;
             tree._rowMap.splice(index, 0, child);
 
-            let kidsAdded = recursivelyAddToMap(child, index);
+            let kidsAdded = recursivelyAddToMap(child, index, tree);
             count += kidsAdded;
             // Somehow the aNewIndex turns into a string without this
             aNewIndex = Number(aNewIndex) + kidsAdded;
           }
         }
         return count;
       }
-      recursivelyAddToMap(this._rowMap[aIndex], aIndex);
+      // work around bug 658534 by passing in "this" instead of let tree = this;
+      recursivelyAddToMap(this._rowMap[aIndex], aIndex, this);
 
       // Add this folder to the persist map
       if (!this._persistOpenMap[this.mode])
         this._persistOpenMap[this.mode] = [];
       let id = this._rowMap[aIndex].id;
       if (this._persistOpenMap[this.mode].indexOf(id) == -1)
         this._persistOpenMap[this.mode].push(id);