Bug 245325 Fix addressbook's abuse of menulists r/sr=mscott

This commit is contained in:
neil%parkwaycc.co.uk 2004-06-03 16:52:06 +00:00
parent 9fa6f67864
commit 8792be5aaa
4 changed files with 3 additions and 53 deletions

View File

@ -136,22 +136,7 @@ function SelectDirectory(aURI)
// set popup with address book names
var abPopup = document.getElementById('abPopup');
if ( abPopup )
{
var menupopup = document.getElementById('abPopup-menupopup');
if ( selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
}
abPopup.value = selectedAB;
setSearchScope(GetScopeForDirectoryURI(selectedAB));
}

View File

@ -115,26 +115,6 @@ var gAddressBookPanelAbListener = {
function LoadPreviouslySelectedAB()
{
var abPopup = document.getElementById('addressbookList');
if ( abPopup )
{
var menupopup = document.getElementById('addressbookList-menupopup');
var selectedAB = abPopup.getAttribute("selectedAB");
if (!selectedAB)
selectedAB = kPersonalAddressbookURI;
if ( selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
}
ChangeDirectoryByURI(abPopup.selectedItem.id);
}

View File

@ -67,7 +67,7 @@
<hbox id="panel-bar" class="toolbar" align="center">
<menulist id="addressbookList"
oncommand="DirPaneSelectionChangeMenulist(); AbPanelOnChange(event)" flex="1"
persist="selectedAB">
persist="value">
<menupopup id="addressbookList-menupopup"
datasources="rdf:addressdirectory"
ref="moz-abdirectory://"

View File

@ -138,22 +138,7 @@ function SelectDirectory(aURI)
// set popup with address book names
var abPopup = document.getElementById('abPopup');
if ( abPopup )
{
var menupopup = document.getElementById('abPopup-menupopup');
if ( selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
}
abPopup.value = selectedAB;
setSearchScope(GetScopeForDirectoryURI(selectedAB));
}