In IE, tell Evergreen to return just the initially visible facets, and do it async...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 11 Sep 2010 02:12:41 +0000 (02:12 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 11 Sep 2010 02:12:41 +0000 (02:12 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17601 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js

index 19d69f0..dab6bb9 100644 (file)
@@ -47,12 +47,28 @@ if(!dojo._hasResource["openils.widget.FacetSidebar"]) {
 
                 if (openils.widget.Searcher._cache.facetData) {
                     this.facetData = openils.widget.Searcher._cache.facetData;
+                    this._render_callback();
                 } else {
-                    var facetData = fieldmapper.standardRequest( [ 'open-ils.search', 'open-ils.search.facet_cache.retrieve'], this.facetCacheKey );
-                    if (!facetData) return;
-                    this.facetData = openils.widget.Searcher._cache.facetData = facetData;
+                    var limit = dojo.isIE ? this.facetLimit : null;
+                    var self = this;
+                    fieldmapper.standardRequest( 
+                        [ 'open-ils.search', 'open-ils.search.facet_cache.retrieve'], 
+                        { async : true,
+                          params : [this.facetCacheKey, limit],
+                          oncomplete : function(r) {
+                              var facetData = r.recv().content();
+                              if (!facetData) return;
+                              self.facetData = openils.widget.Searcher._cache.facetData = facetData;
+                              self._render_callback();
+                          }
+                        }
+                    );
                 }
 
+            },
+
+            _render_callback : function(facetData) {
+               var facetData = this.facetData;
                 var classes = openils.widget.Searcher._cache.arr.cmc;
                 if (this.classOrder && this.classOrder.length > 0) {
                     classes = [];