Bug #301352 --> Broken Search Messages Dialog when opened with a virtual folder selected

sr=bienvenu
a=asa
This commit is contained in:
scott%scott-macgregor.org 2005-07-20 22:11:24 +00:00
Родитель 51a93f8151
Коммит 5ca2ae2c12
1 изменённых файлов: 2 добавлений и 20 удалений

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

@ -327,32 +327,14 @@ function onResetSearch(event) {
gStatusFeedback.showStatusString("");
}
function getFirstItemByTag(root, tag)
{
var node;
if (root.localName == tag)
return root;
if (root.childNodes) {
for (node = root.firstChild; node; node=node.nextSibling) {
if (node.localName != "template") {
var result = getFirstItemByTag(node, tag);
if (result) return result;
}
}
}
return null;
}
function selectFolder(folder)
{
var folderURI;
// if we can't search messages on this folder, just select the first one
if (!folder || !folder.server.canSearchMessages || (folder.flags & MSG_FOLDER_FLAG_VIRTUAL)) {
// walk folders to find first item
var firstItem = getFirstItemByTag(gFolderPicker, "menu");
folderURI = firstItem.id;
// find first item in our folder picker menu list
folderURI = gFolderPicker.firstChild.tree.builderView.getResourceAtIndex(0).Value;
} else {
folderURI = folder.URI;
}