clear card pane if selecting a directory with no cards,

compose not working if you select a directory with now cards
I thought this was a problem with nsOutlinerSelection,
but it was really a problem with my js,
selecting the first card even when there wasn't one.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110027 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com
2001-12-07 21:31:58 +00:00
parent c72a86432b
commit 86e6e30916
2 changed files with 13 additions and 6 deletions

View File

@@ -297,8 +297,10 @@ function GetSelectedAddresses()
var selectedAddresses = "";
var cards = GetSelectedAbCards();
var count = cards.length;
if (!cards)
return selectedAddresses;
var count = cards.length;
for (var i = 0; i < count; i++) {
var generatedAddress = GenerateAddressFromCard(cards[i]);
@@ -501,8 +503,14 @@ function ChangeDirectoryByDOMNode(dirNode)
UpdateSortIndicators(actualSortColumn, sortDirection);
setTimeout('SelectFirstCard();',0);
// only select the first card if there is a first card
if (gAbView && gAbView.getCardFromRow(0)) {
SelectFirstCard();
}
else {
// the selection changes if we were switching directories.
ResultsPaneSelectionChanged()
}
return;
}

View File

@@ -195,8 +195,8 @@ function AddSelectedAddressesIntoBucket(prefix)
for (var i = 0; i < count; i++) {
AddCardIntoBucket(prefix, cards[i]);
}
}
}
}
function AddCardIntoBucket(prefix, card)
{
@@ -368,7 +368,6 @@ function DropOnBucketPane(event)
if (!address)
continue;
//dump(" Address #" + i + " = " + address + "\n");
AddAddressIntoBucket(prefixTo + address, address);
}