ignore clicks to the dir tree header in the addressbook window, we don't want to sort

fix for bug #210950
double clicking past the last row in the dir tree should not act like you double
clicked the select addressbook / LDAP server / mailing list

r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2003-06-28 04:05:48 +00:00
Родитель 0542fec384
Коммит faf7d6756c
3 изменённых файлов: 15 добавлений и 4 удалений

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

@ -640,8 +640,10 @@ function DirPaneClick(event)
return;
// if the user clicks on the header / trecol, do nothing
if (event.originalTarget.localName == "treecol")
if (event.originalTarget.localName == "treecol") {
event.preventBubble();
return;
}
var searchInput = document.getElementById("searchInput");
// if there is a searchInput element, and it's not blank
@ -655,10 +657,17 @@ function DirPaneClick(event)
function DirPaneDoubleClick(event)
{
// if the user clicks on the header / trecol, do nothing
if (event.originalTarget.localName == "treecol")
// we only care about left button events
if (event.button != 0)
return;
var row = {}, colID = {}, childElt = {};
dirTree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, colID, childElt);
if (row.value == -1 || row.value > dirTree.view.rowCount-1) {
// double clicking on a non valid row should not open the dir properties dialog
return;
}
if (dirTree && dirTree.treeBoxObject.selection && dirTree.treeBoxObject.selection.count == 1)
AbEditSelectedDirectory();
}

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

@ -39,7 +39,6 @@ Contributors:
flags="dont-build-content"
hidecolumnpicker="true"
onselect="DirPaneSelectionChange(); document.commandDispatcher.updateCommands('addrbook-select');"
onclick="DirPaneClick(event);"
ondblclick="DirPaneDoubleClick(event);"
onblur="goOnEvent(this,'blur')">

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

@ -165,6 +165,9 @@ function OnLoadAddressBook()
var addrbookSession = Components.classes["@mozilla.org/addressbook/services/session;1"].getService().QueryInterface(Components.interfaces.nsIAddrBookSession);
// this listener only cares when a directory is removed
addrbookSession.addAddressBookListener(gAddressBookAbListener, Components.interfaces.nsIAbListener.directoryRemoved);
var dirTree = GetDirTree();
dirTree.addEventListener("click",DirPaneClick,true);
}
function OnLoadDirTree() {