mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 245325 Fix addressbook's abuse of menulists r/sr=mscott
This commit is contained in:
parent
9fa6f67864
commit
8792be5aaa
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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://"
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user