Simplify addressbookpicker code to something that works b=245325 r/sr=sspitzer moa=bienvenu

This commit is contained in:
neil%parkwaycc.co.uk 2004-06-05 21:45:06 +00:00
Родитель 325c3b1eb0
Коммит b8043db0c3
3 изменённых файлов: 3 добавлений и 63 удалений

Просмотреть файл

@ -123,29 +123,7 @@ function OnLoadNewCard()
// set popup with address book names // set popup with address book names
var abPopup = document.getElementById('abPopup'); var abPopup = document.getElementById('abPopup');
if ( abPopup ) abPopup.value = editCard.selectedAB || kPersonalAddressbookURI;
{
var menupopup = document.getElementById('abPopup-menupopup');
if ( editCard.selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == editCard.selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
else {
// Default to the first valid addressbook when none is
// selected. (the 0th is an empty/invalid entry)
abPopup.label = menupopup.childNodes[1].getAttribute('label');
abPopup.value = menupopup.childNodes[1].getAttribute('value');
}
}
if (gHideABPicker && abPopup) { if (gHideABPicker && abPopup) {
abPopup.hidden = true; abPopup.hidden = true;

Просмотреть файл

@ -123,29 +123,7 @@ function OnLoadNewCard()
// set popup with address book names // set popup with address book names
var abPopup = document.getElementById('abPopup'); var abPopup = document.getElementById('abPopup');
if ( abPopup ) abPopup.value = editCard.selectedAB || kPersonalAddressbookURI;
{
var menupopup = document.getElementById('abPopup-menupopup');
if ( editCard.selectedAB && menupopup && menupopup.childNodes )
{
for ( var index = menupopup.childNodes.length - 1; index >= 0; index-- )
{
if ( menupopup.childNodes[index].getAttribute('value') == editCard.selectedAB )
{
abPopup.label = menupopup.childNodes[index].getAttribute('label');
abPopup.value = menupopup.childNodes[index].getAttribute('value');
break;
}
}
}
else {
// Default to the first valid addressbook when none is
// selected. (the 0th is an empty/invalid entry)
abPopup.label = menupopup.childNodes[1].getAttribute('label');
abPopup.value = menupopup.childNodes[1].getAttribute('value');
}
}
if (gHideABPicker && abPopup) { if (gHideABPicker && abPopup) {
abPopup.hidden = true; abPopup.hidden = true;

Просмотреть файл

@ -226,23 +226,7 @@ function OnLoadNewMailList()
// set popup with address book names // set popup with address book names
var abPopup = document.getElementById('abPopup'); var abPopup = document.getElementById('abPopup');
if ( abPopup ) abPopup.value = selectedAB;
{
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;
}
}
}
}
AppendNewRowAndSetFocus(); AppendNewRowAndSetFocus();
awFitDummyRows(1); awFitDummyRows(1);