Bug 411803 - Middle-clicking a folder doesn't work, unless the bookmark items have been shown. r=dietrich.

This commit is contained in:
mozilla.mano%sent.com 2008-01-13 04:03:22 +00:00
Родитель 5cba1a7f6b
Коммит 6c55a1679c
1 изменённых файлов: 15 добавлений и 6 удалений

Просмотреть файл

@ -1604,26 +1604,35 @@ var PlacesUtils = {
} }
} }
else { else {
let result, oldViewer; let result, oldViewer, wasOpen;
try { try {
let wasOpen = aNode.containerOpen; let wasOpen = aNode.containerOpen;
result = aNode.parentResult;
oldViewer = result.viewer;
if (!wasOpen) { if (!wasOpen) {
result = aNode.parentResult;
oldViewer = result.viewer;
result.viewer = null; result.viewer = null;
aNode.containerOpen = true; aNode.containerOpen = true;
} }
for (let i = 0; i < aNode.childCount; ++i) { for (let i = 0; i < aNode.childCount; ++i) {
// Include visible url nodes only // Include visible url nodes only
let child = aNode.getChild(i); let child = aNode.getChild(i);
if (child.viewIndex != -1 && this.nodeIsURI(child)) if (this.nodeIsURI(child)) {
urls.push({uri: child.uri, isBookmark: this.nodeIsBookmark(child)}); // If the node contents is visible, add the uri only if its node is
// visible. Otherwise follow viewer's collapseDuplicates property,
// default to true
if ((wasOpen && oldViewer && child.viewIndex != -1) ||
(oldViewer && !oldViewer.collapseDuplicates) ||
urls.indexOf(child.uri) == -1) {
urls.push({ uri: child.uri,
isBookmark: this.nodeIsBookmark(child) });
}
}
} }
if (!wasOpen) if (!wasOpen)
aNode.containerOpen = false; aNode.containerOpen = false;
} }
finally { finally {
if (oldViewer) if (!wasOpen)
result.viewer = oldViewer; result.viewer = oldViewer;
} }
} }