fix for #118276. multiple selection in the addressbook should

clear out the card preview pane.  r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2002-01-05 03:48:41 +00:00
parent 9c150d70b2
commit 28e9751741
3 changed files with 10 additions and 6 deletions

View File

@ -74,7 +74,7 @@ function AbResultsPaneOnClick(event)
AbResultsPaneDoubleClick(gAbView.getCardFromRow(row.value));
}
else {
OnClickedCard(gAbView.getCardFromRow(row.value));
UpdateCardView();
}
}
}

View File

@ -218,17 +218,19 @@ function ResultsPaneSelectionChanged()
function UpdateCardView()
{
var card = GetSelectedCard();
var cards = GetSelectedAbCards();
// display the selected card, if exactly one card is selected.
// either no cards, or more than one card is selected, clear the pane.
OnClickedCard(card)
if (cards.length == 1)
OnClickedCard(cards[0])
else
ClearCardViewPane();
}
// if card is null, OnClickedCard() must clear the card pane
function OnClickedCard(card)
{
if (card)
{
if (card)
DisplayCardViewPane(card);
else
ClearCardViewPane();

View File

@ -839,6 +839,7 @@ nsresult nsAbView::AddCard(AbCard *abcard, PRBool selectCardAfterAdding, PRInt32
rv = mCards.InsertElementAt((void *)abcard, *index);
NS_ENSURE_SUCCESS(rv,rv);
// this needs to happen after we insert the card, as RowCountChanged() will call GetRowCount()
if (mOutliner)
rv = mOutliner->RowCountChanged(*index, 1);
@ -911,6 +912,7 @@ nsresult nsAbView::RemoveCardAndSelectNextCard(nsISupports *item)
rv = RemoveCardAt(index);
NS_ENSURE_SUCCESS(rv,rv);
// this needs to happen after we remove the card, as RowCountChanged() will call GetRowCount()
if (mOutliner) {
rv = mOutliner->RowCountChanged(index, -1);
NS_ENSURE_SUCCESS(rv,rv);