prevent deleting Inbox and Trash folder; r=scottip

This commit is contained in:
jefft%netscape.com 2000-04-01 17:47:21 +00:00
Родитель 3b4bb656ae
Коммит 9f9610152f
1 изменённых файлов: 23 добавлений и 12 удалений

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

@ -68,7 +68,13 @@ var FolderPaneController =
goSetMenuValue(command, 'valueFolder');
var folderTree = GetFolderTree();
if ( folderTree && folderTree.selectedItems )
return true;
{
var specialFolder = folderTree.selectedItems[0].getAttribute('SpecialFolder');
if (specialFolder == "Inbox" || specialFolder == "Trash")
return false;
else
return true;
}
else
return false;
@ -462,21 +468,26 @@ function MsgDeleteFolder()
var folderList = tree.selectedItems;
var i;
var folder, parent;
var specialFolder;
for(i = 0; i < folderList.length; i++)
{
folder = folderList[i];
folderuri = folder.getAttribute('id');
dump(folderuri);
parent = folder.parentNode.parentNode;
var parenturi = parent.getAttribute('id');
if(parenturi)
dump(parenturi);
else
dump("No parenturi");
dump("folder = " + folder.nodeName + "\n");
dump("parent = " + parent.nodeName + "\n");
messenger.DeleteFolders(tree.database,
parent.resource, folder.resource);
specialFolder = folder.getAttribute('SpecialFolder');
if (specialFolder != "Inbox" && specialFolder != "Trash")
{
dump(folderuri);
parent = folder.parentNode.parentNode;
var parenturi = parent.getAttribute('id');
if(parenturi)
dump(parenturi);
else
dump("No parenturi");
dump("folder = " + folder.nodeName + "\n");
dump("parent = " + parent.nodeName + "\n");
messenger.DeleteFolders(tree.database,
parent.resource, folder.resource);
}
}