Mercurial > snowl
changeset 48:241f8a8ad7a8
reinitialize the view when the number of rows changes so that the tree updates the number of rows it contains
author | Myk Melez <myk@mozilla.org> |
---|---|
date | Thu, 01 May 2008 18:42:35 -0700 |
parents | 4036d4b914bc |
children | 090d5ab4a449 |
files | extension/content/snowl.js |
diffstat | 1 files changed, 15 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/extension/content/snowl.js Thu May 01 16:55:41 2008 -0700 +++ b/extension/content/snowl.js Thu May 01 18:42:35 2008 -0700 @@ -279,13 +279,21 @@ // Event & Notification Handling _onMessagesChanged: function() { +this._log.info("_onMessagesChanged"); this._rebuildModel(); - this._tree.boxObject.invalidate(); + + // The number of rows might have changed, so we need to let the tree know + // about that, and the simplest way to do it is to reinitialize the view. + this._tree.view = this; }, onFilter: function() { +this._log.info("onFilter"); this._rebuildModel(); - this._tree.boxObject.invalidate(); + + // The number of rows might have changed, so we need to let the tree know + // about that, and the simplest way to do it is to reinitialize the view. + this._tree.view = this; }, // From toolkit/mozapps/update/content/history.js @@ -517,9 +525,13 @@ }, setSource: function(aSourceID) { +this._log.info("setSource: " + aSourceID); this.sourceID = aSourceID; this._rebuildModel(); - this._tree.boxObject.invalidate(); + + // The number of rows might have changed, so we need to let the tree know + // about that, and the simplest way to do it is to reinitialize the view. + this._tree.view = this; }, toggle: function() {