From f34413b495d6b7aa748735fc772ce806071f49a5 Mon Sep 17 00:00:00 2001 From: "sspitzer%mozilla.org" Date: Sun, 30 May 2004 18:08:26 +0000 Subject: [PATCH] fix for bug #67555 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 --- .../resources/content/abMailListDialog.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mailnews/addrbook/resources/content/abMailListDialog.js b/mailnews/addrbook/resources/content/abMailListDialog.js index 88126a055405..5d9b4b9cc1b7 100644 --- a/mailnews/addrbook/resources/content/abMailListDialog.js +++ b/mailnews/addrbook/resources/content/abMailListDialog.js @@ -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;