# HG changeset patch # User alta88 # Date 1225646918 25200 # Node ID 8d90feea857c667c3ac8b72015e463ea4318a39e # Parent e9d7087abad1b188301cdf5ae3a00c60630baab8# Parent 9171e373cb1fb6717ac10c68228b83b4ad6ecdb3 Merge with 9171e373cb1fb6717ac10c68228b83b4ad6ecdb3 diff -r 9171e373cb1f -r 8d90feea857c content/collections.js --- a/content/collections.js Fri Oct 31 16:57:52 2008 -0700 +++ b/content/collections.js Sun Nov 02 10:28:38 2008 -0700 @@ -86,14 +86,7 @@ // Ensure collection selection maintained, if in List sidebar if (document.getElementById("snowlSidebar")) - this._tree.view.selection.select( - gMessageViewWindow.SnowlMessageView._listCollectionIndex); - - // Add a capturing click listener to the tree so we can find out if the user - // clicked on a row that is already selected (in which case we let them edit - // the collection name). - // FIXME: disable this for names that can't be changed. - this._tree.addEventListener("mousedown", function(aEvent) { CollectionsView.onClick(aEvent) }, true); + this._tree.view.selection.select(SnowlUtils.gListViewCollectionIndex); }, @@ -314,25 +307,21 @@ }, onSelect: function(aEvent) { - if (this._tree.currentIndex == -1) + if (this._tree.currentIndex == -1 || SnowlUtils.gRightMouseButtonDown) return; let collection = this._rows[this._tree.currentIndex]; - let index = this._tree.currentIndex; - gMessageViewWindow.SnowlMessageView.setCollection(collection, index); + SnowlUtils.gListViewCollectionIndex = this._tree.currentIndex; + gMessageViewWindow.SnowlMessageView.setCollection(collection); }, - onClick: function(aEvent) { -this._log.info("on click"); -//this._log.info(Log4Moz.enumerateProperties(aEvent).join("\n")); -//this._log.info(aEvent.target.nodeName); + onCollectionsTreeMouseDown: function(aEvent) { + SnowlUtils.onTreeMouseDown(aEvent, this._tree); + }, - let row = {}, col = {}, child = {}; - this._tree.treeBoxObject.getCellAt(aEvent.clientX, aEvent.clientY, row, col, child); - if (this._tree.view.selection.isSelected(row.value)) -this._log.info(row.value + " is selected"); -else -this._log.info(row.value + " is not selected"); + onTreeContextPopupHidden: function() { + if (!SnowlUtils.gSelectOnRtClick) + SnowlUtils.RestoreSelectionWithoutContentLoad(this._tree); }, unsubscribe: function() { diff -r 9171e373cb1f -r 8d90feea857c content/collections.xul --- a/content/collections.xul Fri Oct 31 16:57:52 2008 -0700 +++ b/content/collections.xul Sun Nov 02 10:28:38 2008 -0700 @@ -45,13 +45,24 @@