From 8039026b667740db5668fa3875cf2a71c2774454 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Fri, 11 Jun 2004 11:48:14 +0000 Subject: [PATCH] Bug 245325 Really fix addressbook's abuse of menulists r/sr=mscott --- .../addrbook/content/abContactsPanel.js | 12 +- .../addrbook/content/abContactsPanel.xul | 2 +- .../prefs/resources/content/pref-directory.js | 107 ++++-------------- .../resources/content/addressbook-panel.js | 32 +----- .../resources/content/addressbook-panel.xul | 4 +- 5 files changed, 32 insertions(+), 125 deletions(-) diff --git a/mail/components/addrbook/content/abContactsPanel.js b/mail/components/addrbook/content/abContactsPanel.js index dd97f63c4bb..974d7831c9b 100644 --- a/mail/components/addrbook/content/abContactsPanel.js +++ b/mail/components/addrbook/content/abContactsPanel.js @@ -87,7 +87,7 @@ var gAddressBookPanelAbListener = { // if so, select the person addressbook (it can't be removed) if (directory == GetAbView().directory) { var abPopup = document.getElementById('addressbookList'); - abPopup.setAttribute("selectedAB", kPersonalAddressbookURI); + abPopup.value = kPersonalAddressbookURI; LoadPreviouslySelectedAB(); } } @@ -115,6 +115,9 @@ var gAddressBookPanelAbListener = { function LoadPreviouslySelectedAB() { var abPopup = document.getElementById('addressbookList'); + var value = abPopup.value || kPersonalAddressbookURI; + abPopup.selectedItem = null; + abPopup.value = value; ChangeDirectoryByURI(abPopup.selectedItem.id); } @@ -135,13 +138,6 @@ function AbPanelLoad() gSearchInput = document.getElementById("searchInput"); } - -function AbPanelOnChange(event) -{ - var abPopup = document.getElementById('addressbookList'); - abPopup.setAttribute("selectedAB", abPopup.value); -} - function AbPanelUnload() { var addrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession); diff --git a/mail/components/addrbook/content/abContactsPanel.xul b/mail/components/addrbook/content/abContactsPanel.xul index 8e3c3c4cefc..0a06aab8520 100644 --- a/mail/components/addrbook/content/abContactsPanel.xul +++ b/mail/components/addrbook/content/abContactsPanel.xul @@ -66,7 +66,7 @@