Bug 450712: "INBOX" is always displayed as selected folder name of "When I delete a message/Move it to this folder". r=bienvenu, sr=neil

This commit is contained in:
Magnus Melin 2008-10-05 12:10:37 +03:00
Родитель 06dddc56ef
Коммит 03fb01509b
2 изменённых файлов: 10 добавлений и 4 удалений

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

@ -272,7 +272,7 @@ function setupImapDeleteUI(aServerId)
{ {
// read delete_model preference // read delete_model preference
var deleteModel = document.getElementById("imap.deleteModel").getAttribute("value"); var deleteModel = document.getElementById("imap.deleteModel").getAttribute("value");
selectImapDeleteModel(deleteModel) selectImapDeleteModel(deleteModel);
// read trash_folder_name preference // read trash_folder_name preference
var trashFolderName = getTrashFolderName(); var trashFolderName = getTrashFolderName();
@ -320,8 +320,15 @@ function selectImapDeleteModel(choice)
// Capture any menulist changes from folderPicker // Capture any menulist changes from folderPicker
function folderPickerChange(aEvent) function folderPickerChange(aEvent)
{ {
var folder = aEvent.target._folder;
// Set the value to be persisted.
document.getElementById("imap.trashFolderName") document.getElementById("imap.trashFolderName")
.setAttribute("value", aEvent.target._folder.name); .setAttribute("value", folder.name);
// Update the widget to show/do correct things even for subfolders.
var trashFolderPicker = document.getElementById("msgTrashFolderPicker");
trashFolderPicker.setAttribute("label", folder.prettyName);
} }
// Get trash_folder_name from prefs // Get trash_folder_name from prefs

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

@ -663,8 +663,7 @@
var child = this.childNodes[i]; var child = this.childNodes[i];
if (!child || !child._folder) if (!child || !child._folder)
continue; continue;
if (child._folder.URI == aFolder.URI || (this._parentFolder && if (child._folder.URI == aFolder.URI) {
this._parentFolder.isAncestorOf(aFolder))) {
// Making an assumption about our DOM positioning here. // Making an assumption about our DOM positioning here.
this.parentNode.selectedIndex = i; this.parentNode.selectedIndex = i;
return; return;