mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 05:47:04 +00:00
bug 566613 - fix typo wasVisbile in treeView.js and use nodeAncestors in invisible node lookup, r=Mano
This commit is contained in:
parent
61a92e1f54
commit
4897cfe53d
@ -168,11 +168,14 @@ PlacesTreeView.prototype = {
|
||||
if (aNode == this._rootNode)
|
||||
throw "The root node is never visible";
|
||||
|
||||
let parent = aNode.parent;
|
||||
if (!parent || !parent.containerOpen)
|
||||
throw "Invisible node passed to _getRowForNode";
|
||||
let ancestors = PlacesUtils.nodeAncestors(aNode);
|
||||
for (let ancestor in ancestors) {
|
||||
if (!ancestor.containerOpen)
|
||||
throw "Invisible node passed to _getRowForNode";
|
||||
}
|
||||
|
||||
// Non-plain containers are initially built with their contents.
|
||||
let parent = aNode.parent;
|
||||
let parentIsPlain = this._isPlainContainer(parent);
|
||||
if (!parentIsPlain) {
|
||||
if (parent == this._rootNode)
|
||||
@ -384,7 +387,7 @@ PlacesTreeView.prototype = {
|
||||
nodesInfo.push({
|
||||
node: this._rows[i],
|
||||
oldRow: i,
|
||||
wasVisbile: i >= firstVisibleRow && i <= lastVisibleRow
|
||||
wasVisible: i >= firstVisibleRow && i <= lastVisibleRow
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -712,7 +715,7 @@ PlacesTreeView.prototype = {
|
||||
return;
|
||||
|
||||
// Restore selection.
|
||||
let rowToSelect = Math.min(oldRow, this._rows.length - 1);
|
||||
let rowToSelect = Math.min(oldRow, this._rows.length - 1);
|
||||
this.selection.rangedSelect(rowToSelect, rowToSelect, true);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user