зеркало из https://github.com/mozilla/pjs.git
Simplify addressbookpicker code to something that works b=245325 r/sr=sspitzer moa=bienvenu
This commit is contained in:
Родитель
325c3b1eb0
Коммит
b8043db0c3
|
@ -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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче