Bug 293141 Fix "Copy" filter action UI issues r+a=shaver sr=bienvenu

This commit is contained in:
neil%parkwaycc.co.uk 2005-05-06 16:42:29 +00:00
parent d1574edf45
commit 987ae6bf26
2 changed files with 18 additions and 13 deletions

View File

@ -48,6 +48,7 @@ var gFilter;
var gFilterList;
var gFilterNameElement;
var gActionTargetElement;
var gActionTargetMoveElement;
var gActionTargetCopyElement;
var gActionValueDeck;
var gActionPriority;
@ -261,7 +262,7 @@ function setLabelAttributes(labelID, menuItemID)
function initializeFilterWidgets()
{
gFilterNameElement = document.getElementById("filterName");
gActionTargetElement = document.getElementById("actionTargetFolder");
gActionTargetMoveElement = document.getElementById("actionTargetFolder");
gActionTargetCopyElement = document.getElementById("actionTargetFolder2");
gActionValueDeck = document.getElementById("actionValueDeck");
gActionPriority = document.getElementById("actionValuePriority");
@ -297,7 +298,7 @@ function initializeDialog(filter)
gMoveToFolderCheckbox.checked = true;
var target = filterAction.targetFolderUri;
if (target)
SetFolderPicker(target, gActionTargetElement.id);
SetFolderPicker(target, gActionTargetMoveElement.id);
}
else if (filterAction.type == nsMsgFilterAction.CopyToFolder)
{
@ -436,8 +437,8 @@ function saveFilter()
if (gMoveToFolderCheckbox.checked)
{
if (gActionTargetElement)
targetUri = gActionTargetElement.getAttribute("uri");
if (gActionTargetMoveElement)
targetUri = gActionTargetMoveElement.getAttribute("uri");
if (!targetUri || targetUri == "")
{
if (gPromptService)
@ -678,12 +679,14 @@ function showLabelColorFor(menuitem)
function GetFirstSelectedMsgFolder()
{
var selectedFolder = gActionTargetElement.getAttribute("uri");
if (!selectedFolder)
return null;
var msgFolder = GetMsgFolderFromUri(selectedFolder, true);
return msgFolder;
}
function SearchNewFolderOkCallback(name,uri,targetid)
function SearchNewFolderOkCallback(name, uri)
{
var msgFolder = GetMsgFolderFromUri(uri, true);
var imapFolder = null;
@ -719,7 +722,7 @@ function SearchNewFolderOkCallback(name,uri,targetid)
if (!imapFolder)
{
var curFolder = uri+"/"+encodeURIComponent(name);
SetFolderPicker(curFolder, targetid);
SetFolderPicker(curFolder, gActionTargetElement.id);
}
}

View File

@ -106,22 +106,24 @@
</listcell>
<listcell>
<button id="newFolderButton" enablefornews="false" label="&newFolderButton.label;"
accesskey="&newFolderButton.accesskey;"
oncommand="MsgNewFolder(function (name,uri){ SearchNewFolderOkCallback(name,uri,'actionTargetFolder'); } )"/>
accesskey="&newFolderButton.accesskey;"
oncommand="gActionTargetElement = gActionTargetMoveElement;
MsgNewFolder(SearchNewFolderOkCallback);"/>
</listcell>
</listitem>
<listitem allowevents="true">
<listcell>
<checkbox id="copyToFolder" enablefornews="false" label="&copyToFolder.label;"/>
<checkbox id="copyToFolder" label="&copyToFolder.label;"/>
</listcell>
<listcell>
<menulist id="actionTargetFolder2" enablefornews="false" flex="1"/>
<menulist id="actionTargetFolder2" flex="1"/>
</listcell>
<listcell>
<button id="copyNewFolderButton" enablefornews="false" label="&newFolderButton.label;"
accesskey="&newFolderButton.accesskey;"
oncommand="MsgNewFolder(function (name,uri){ SearchNewFolderOkCallback(name,uri,'actionTargetFolder2'); } )"/>
<button id="copyNewFolderButton" label="&newFolderButton.label;"
accesskey="&newFolderButton.accesskey;"
oncommand="gActionTargetElement = gActionTargetCopyElement;
MsgNewFolder(SearchNewFolderOkCallback);"/>
</listcell>
</listitem>