Bug #217252 --> Contacts panel is double click trigger happy

This commit is contained in:
scott%scott-macgregor.org 2003-08-25 21:33:37 +00:00
Родитель 513c15a45b
Коммит adc03f1297
2 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -39,6 +39,26 @@ function GetAbViewListener()
// the ab panel doesn't care if the total changes, or if the selection changes
return null;
}
function contactsListDoubleClick(event)
{
// we only care about button 0 (left click) events
if (event.button != 0)
return;
var row = {}, colID = {}, childElt = {};
var contactsTree = document.getElementById("abResultsTree");
contactsTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, colID, childElt);
if (row.value == -1 || row.value > contactsTree.view.rowCount-1 || event.originalTarget.localName != "treechildren")
{
// double clicking on a non valid row should not open the edit filter dialog
return;
}
// ok, go ahead and add the entry
addSelectedAddresses('addr_to');
}
function addSelectedAddresses(recipientType)
{

Просмотреть файл

@ -97,14 +97,14 @@
<separator class="thin"/>
<tree id="abResultsTree" flex="1" context="cardProperties" class="plain" sortCol="GeneratedName" persist="sortCol" ondblclick="addSelectedAddresses('addr_to')">
<tree id="abResultsTree" flex="1" context="cardProperties" class="plain" sortCol="GeneratedName" persist="sortCol" ondblclick="contactsListDoubleClick(event);">
<treecols>
<!-- these column ids must match up to the mork column names, see nsIAddrDatabase.idl -->
<treecol id="GeneratedName" class="sortDirectionIndicator"
persist="hidden ordinal width sortDirection" flex="1" label="&GeneratedName.label;" primary="true"/>
<splitter class="tree-splitter"/>
<treecol id="PrimaryEmail" class="sortDirectionIndicator"
persist="hidden ordinal width sortDirection" hiddenbydefault="true"
persist="hidden ordinal width sortDirection" hidden="true"
flex="1" label="&PrimaryEmail.label;"/>
</treecols>
<treechildren ondraggesture="nsDragAndDrop.startDrag(event, abResultsPaneObserver);"/>