diff --git a/content/collections.js b/content/collections.js index b601f64..3a0957a 100644 --- a/content/collections.js +++ b/content/collections.js @@ -371,9 +371,15 @@ this._log.info("onClick: START itemIds - " +this.itemIds.toSource()); onSearch: function(aValue) { this.Filters["searchterms"] = aValue ? aValue : null; - gMessageViewWindow.SnowlMessageView.onFilter(this.Filters); - if (!aValue) - this._tree.place = this._tree.place; + + if (this.itemIds == -1 && !aValue) + // If no selection and clearing searchbox, clear list (don't select 'All'). + gMessageViewWindow.SnowlMessageView.onCollectionsDeselect(); + else + // Search selected or 'All Messages' if no explicit selection. + gMessageViewWindow.SnowlMessageView.onFilter(this.Filters); +// if (!aValue) +// this._tree.place = this._tree.place; }, onCommandUnreadButton: function(aEvent) { @@ -381,6 +387,11 @@ this._log.info("onClick: START itemIds - " +this.itemIds.toSource()); // properties and pseudo element selectors. aEvent.target.checked = !aEvent.target.checked; this.Filters["unread"] = aEvent.target.checked ? true : false; + + if (this.itemIds == -1) + // If no selection. + return; + gMessageViewWindow.SnowlMessageView.onFilter(this.Filters); }, @@ -393,6 +404,10 @@ this._log.info("onClick: START itemIds - " +this.itemIds.toSource()); else document.getElementById("snowlPurgeDeletedButton").setAttribute("disabled", true); + if (this.itemIds == -1) + // If no selection. + return; + gMessageViewWindow.SnowlMessageView.onFilter(this.Filters); }, diff --git a/locale/en-US/toolbar.dtd b/locale/en-US/toolbar.dtd index ef16465..9269ea6 100644 --- a/locale/en-US/toolbar.dtd +++ b/locale/en-US/toolbar.dtd @@ -2,8 +2,8 @@ - + - - + + diff --git a/modules/collection.js b/modules/collection.js index e4cfe85..da8c462 100644 --- a/modules/collection.js +++ b/modules/collection.js @@ -308,6 +308,7 @@ this._log.info("got " + groups.length + " groups"); }, clear: function() { + this.constraints = []; this._messages = []; this._messageIndex = {}; },