From 001bbd6da250c85602cfa9b375696c6ed3605693 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 11 Sep 2010 02:12:41 +0000 Subject: [PATCH] In IE, tell Evergreen to return just the initially visible facets, and do it async-y (thanks berick) git-svn-id: svn://svn.open-ils.org/ILS/trunk@17601 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/dojo/openils/widget/FacetSidebar.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js b/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js index 19d69f05f..dab6bb921 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js +++ b/Open-ILS/web/js/dojo/openils/widget/FacetSidebar.js @@ -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 = []; -- 2.11.0