fix shwoing more on refaceting gloda-facet
authorDavid Ascher <david@mozillamessaging.com>
Tue, 08 Sep 2009 23:37:29 -0700
branchgloda-facet
changeset 3721 0aa3281e2ea18b2c2ec642b1c552d05fe8b4698f
parent 3719 0849d1f27da42718391defda0b53fc3392f309ea
child 3722 b6e40f00365caa4376ffe05cafe0bb3f82bd71db
push idunknown
push userunknown
push dateunknown
fix shwoing more on refaceting
mail/base/content/glodaFacetView.js
--- a/mail/base/content/glodaFacetView.js
+++ b/mail/base/content/glodaFacetView.js
@@ -501,49 +501,53 @@ var FacetContext = {
         else {
           faceter.xblNode.orderedGroups = faceter.orderedGroups;
           faceter.xblNode.build(false);
           $(faceter.xblNode).show();
         }
       }
     }
 
-    this.showMore();
+    this._showResults();
 
     if (this._callbackOnFacetComplete) {
       let callback = this._callbackOnFacetComplete;
       this._callbackOnFacetComplete = null;
       callback();
     }
   },
 
-  showMore: function() {
-    this._numPages += 1;
+  _showResults: function()
+  {
     let results = document.getElementById("results");
     let numMessageToShow = Math.min(this.maxMessagesToShow * this._numPages,
                                     this._activeSet.length);
     results.setMessages(this._activeSet.slice(0, numMessageToShow));
 
     let showMore = document.getElementById("showMore");
-
     if (this._activeSet.length > numMessageToShow)
       $(showMore).show();
     else
       $(showMore).hide();
+  },
 
-    if (this._numPages > 1)
-      results.ensureNodeVisible((this._numPages-1) * this.maxMessagesToShow);
+  showMore: function() {
+    this._numPages += 1;
+    this._showResults();
+    let results = document.getElementById("results");
+    let msgIndex = (this._numPages - 1) * this.maxMessagesToShow;
+    results.ensureNodeVisible(msgIndex);
   },
 
   /** For use in hovering specific results. */
   fakeResultFaceter: {},
   /** For use in hovering specific results. */
   fakeResultAttr: {},
 
-  _numPages: 0,
+  _numPages: 1,
   _HOVER_STABILITY_DURATION_MS: 100,
   _brushedFacet: null,
   _brushedGroup: null,
   _brushedItems: null,
   _brushTimeout: null,
   hoverFacet: function(aFaceter, aAttrDef, aGroupValue, aGroupItems) {
     // bail if we are already brushing this item
     if (this._brushedFacet == aFaceter && this._brushedGroup == aGroupValue)