mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Added code to clear the card view when changing address books.
This commit is contained in:
parent
d065301ea8
commit
1548757c5c
@ -14,28 +14,28 @@ function OnLoadAddressBook()
|
||||
"cv" = card view (normal fields) */
|
||||
cvData = new Object;
|
||||
|
||||
/* Card View - Title */
|
||||
// Title
|
||||
cvData.CardTitle = doc.getElementById("CardTitle");
|
||||
/* Name section */
|
||||
// Name section
|
||||
cvData.cvhName = doc.getElementById("cvhName");
|
||||
cvData.cvNickname = doc.getElementById("cvNickname");
|
||||
cvData.cvEmail1 = doc.getElementById("cvEmail1");
|
||||
cvData.cvEmail2 = doc.getElementById("cvEmail2");
|
||||
/* Home section */
|
||||
// Home section
|
||||
cvData.cvhHome = doc.getElementById("cvhHome");
|
||||
cvData.cvHomeAddress = doc.getElementById("cvHomeAddress");
|
||||
cvData.cvHomeCityStZip = doc.getElementById("cvHomeCityStZip");
|
||||
/* Other section */
|
||||
// Other section
|
||||
cvData.cvhOther = doc.getElementById("cvhOther");
|
||||
cvData.cvNotes = doc.getElementById("cvNotes");
|
||||
/* Phone section */
|
||||
// Phone section
|
||||
cvData.cvhPhone = doc.getElementById("cvhPhone");
|
||||
cvData.cvPhWork = doc.getElementById("cvPhWork");
|
||||
cvData.cvPhHome = doc.getElementById("cvPhHome");
|
||||
cvData.cvPhFax = doc.getElementById("cvPhFax");
|
||||
cvData.cvPhCellular = doc.getElementById("cvPhCellular");
|
||||
cvData.cvPhPager = doc.getElementById("cvPhPager");
|
||||
/* Work section */
|
||||
// Work section
|
||||
cvData.cvhWork = doc.getElementById("cvhWork");
|
||||
cvData.cvJobTitle = doc.getElementById("cvJobTitle");
|
||||
cvData.cvOrganization = doc.getElementById("cvOrganization");
|
||||
@ -48,6 +48,10 @@ function ChangeDirectoryByDOMNode(dirNode)
|
||||
var uri = dirNode.getAttribute('id');
|
||||
dump(uri + "\n");
|
||||
ChangeDirectoryByURI(uri);
|
||||
|
||||
// HACK to clear the card view pane - when onchange="MyOnChangeFunction()" is working
|
||||
// then we can do this correctly
|
||||
ClearCardViewPane();
|
||||
}
|
||||
|
||||
|
||||
@ -99,9 +103,10 @@ function DisplayCardViewPane(abNode)
|
||||
var cardResource = parent.parent.rdf.GetResource(uri);
|
||||
var card = cardResource.QueryInterface(Components.interfaces.nsIAbCard);
|
||||
|
||||
var name = card.personName;
|
||||
|
||||
var data = parent.parent.cvData;
|
||||
var visible;
|
||||
var name = card.personName;
|
||||
|
||||
/* set fields in card view pane */
|
||||
visible = cvSetNode(data.CardTitle, "Card for " + name);
|
||||
@ -137,6 +142,40 @@ function DisplayCardViewPane(abNode)
|
||||
cvSetVisible(data.cvhWork, visible);
|
||||
}
|
||||
|
||||
function ClearCardViewPane()
|
||||
{
|
||||
// HACK - we need to be able to set the entire box or div to display:none when bug fixed
|
||||
var data = parent.parent.cvData;
|
||||
|
||||
// title
|
||||
cvSetVisible(data.CardTitle, false);
|
||||
// Name section
|
||||
cvSetVisible(data.cvhName, false);
|
||||
cvSetVisible(data.cvNickname, false);
|
||||
cvSetVisible(data.cvEmail1, false);
|
||||
cvSetVisible(data.cvEmail2, false);
|
||||
// Home section
|
||||
cvSetVisible(data.cvhHome, false);
|
||||
cvSetVisible(data.cvHomeAddress, false);
|
||||
cvSetVisible(data.cvHomeCityStZip, false);
|
||||
// Other section
|
||||
cvSetVisible(data.cvhOther, false);
|
||||
cvSetVisible(data.cvNotes, false);
|
||||
// Phone section
|
||||
cvSetVisible(data.cvhPhone, false);
|
||||
cvSetVisible(data.cvPhWork, false);
|
||||
cvSetVisible(data.cvPhHome, false);
|
||||
cvSetVisible(data.cvPhFax, false);
|
||||
cvSetVisible(data.cvPhCellular, false);
|
||||
cvSetVisible(data.cvPhPager, false);
|
||||
// Work section
|
||||
cvSetVisible(data.cvhWork, false);
|
||||
cvSetVisible(data.cvJobTitle, false);
|
||||
cvSetVisible(data.cvOrganization, false);
|
||||
cvSetVisible(data.cvWorkAddress, false);
|
||||
cvSetVisible(data.cvWorkCityStZip, false);
|
||||
}
|
||||
|
||||
function cvSetNode(node, text)
|
||||
{
|
||||
node.childNodes[0].nodeValue = text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user