fix
bug 658534, fail to expand folder pane items, a=standard8
--- 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);