зеркало из https://github.com/mozilla/gecko-dev.git
Bug #217252 --> Contacts panel is double click trigger happy
This commit is contained in:
Родитель
513c15a45b
Коммит
adc03f1297
|
@ -40,6 +40,26 @@ function GetAbViewListener()
|
|||
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)
|
||||
{
|
||||
var cards = GetSelectedAbCards();
|
||||
|
|
|
@ -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);"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче