зеркало из https://github.com/mozilla/pjs.git
fix for #118276. multiple selection in the addressbook should
clear out the card preview pane. r/sr=bienvenu
This commit is contained in:
Родитель
de6758169d
Коммит
d52a95d26f
|
@ -74,7 +74,7 @@ function AbResultsPaneOnClick(event)
|
||||||
AbResultsPaneDoubleClick(gAbView.getCardFromRow(row.value));
|
AbResultsPaneDoubleClick(gAbView.getCardFromRow(row.value));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
OnClickedCard(gAbView.getCardFromRow(row.value));
|
UpdateCardView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,17 +218,19 @@ function ResultsPaneSelectionChanged()
|
||||||
|
|
||||||
function UpdateCardView()
|
function UpdateCardView()
|
||||||
{
|
{
|
||||||
var card = GetSelectedCard();
|
var cards = GetSelectedAbCards();
|
||||||
|
|
||||||
// display the selected card, if exactly one card is selected.
|
// display the selected card, if exactly one card is selected.
|
||||||
// either no cards, or more than one card is selected, clear the pane.
|
// 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)
|
function OnClickedCard(card)
|
||||||
{
|
{
|
||||||
if (card)
|
if (card)
|
||||||
DisplayCardViewPane(card);
|
DisplayCardViewPane(card);
|
||||||
else
|
else
|
||||||
ClearCardViewPane();
|
ClearCardViewPane();
|
||||||
|
|
|
@ -839,6 +839,7 @@ nsresult nsAbView::AddCard(AbCard *abcard, PRBool selectCardAfterAdding, PRInt32
|
||||||
rv = mCards.InsertElementAt((void *)abcard, *index);
|
rv = mCards.InsertElementAt((void *)abcard, *index);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
||||||
|
// this needs to happen after we insert the card, as RowCountChanged() will call GetRowCount()
|
||||||
if (mOutliner)
|
if (mOutliner)
|
||||||
rv = mOutliner->RowCountChanged(*index, 1);
|
rv = mOutliner->RowCountChanged(*index, 1);
|
||||||
|
|
||||||
|
@ -911,6 +912,7 @@ nsresult nsAbView::RemoveCardAndSelectNextCard(nsISupports *item)
|
||||||
rv = RemoveCardAt(index);
|
rv = RemoveCardAt(index);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
||||||
|
// this needs to happen after we remove the card, as RowCountChanged() will call GetRowCount()
|
||||||
if (mOutliner) {
|
if (mOutliner) {
|
||||||
rv = mOutliner->RowCountChanged(index, -1);
|
rv = mOutliner->RowCountChanged(index, -1);
|
||||||
NS_ENSURE_SUCCESS(rv,rv);
|
NS_ENSURE_SUCCESS(rv,rv);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче