if you first hit OK and get the alert about "list name exists",
cancel will still change mailing list name in the UI

r/sr=bienvenu
This commit is contained in:
sspitzer%mozilla.org 2004-05-30 18:08:26 +00:00
parent a5f2b5f82c
commit f34413b495

View File

@ -79,9 +79,9 @@ function mailingListExists(listname)
function GetListValue(mailList, doAdd)
{
mailList.dirName = document.getElementById('ListName').value;
var listname = document.getElementById('ListName').value;
if (mailList.dirName.length == 0)
if (listname.length == 0)
{
var alertText = gAddressBookBundle.getString("emptyListName");
alert(alertText);
@ -89,21 +89,21 @@ function GetListValue(mailList, doAdd)
}
else
{
var listname = mailList.dirName;
listname = listname.toLowerCase();
oldListName = oldListName.toLowerCase();
var canonicalNewListName = listname.toLowerCase();
var canonicalOldListName = oldListName.toLowerCase();
if (doAdd)
{
if (mailingListExists(listname))
if (mailingListExists(canonicalNewListName))
return false;
}
else if (oldListName != listname)
else if (canonicalOldListName != canonicalNewListName)
{
if (mailingListExists(listname))
if (mailingListExists(canonicalNewListName))
return false;
}
}
mailList.dirName = listname;
mailList.listNickName = document.getElementById('ListNickName').value;
mailList.description = document.getElementById('ListDescription').value;