Delay injecting facet body into the DOM to speed things up a little.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@205 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-05 01:51:01 +00:00
parent 4d893271ca
commit 2227dc8686

View File

@ -109,12 +109,13 @@ ListFacet.prototype.render = function() {
self._remove(); self._remove();
}).prependTo(headerDiv); }).prependTo(headerDiv);
var bodyDiv = $('<div></div>').addClass("facet-body").appendTo(container); var bodyDiv = $('<div></div>').addClass("facet-body");
if (!("scroll" in this._options) || this._options.scroll) { if (!("scroll" in this._options) || this._options.scroll) {
bodyDiv.addClass("facet-body-scrollable"); bodyDiv.addClass("facet-body-scrollable");
} }
if (this._data == null) { if (this._data == null) {
bodyDiv.appendTo(container);
bodyDiv.html("Loading..."); bodyDiv.html("Loading...");
} else { } else {
var selectionCount = this._selection.length var selectionCount = this._selection.length
@ -185,6 +186,7 @@ ListFacet.prototype.render = function() {
renderChoice(this._errorChoice, "(error)"); renderChoice(this._errorChoice, "(error)");
} }
bodyDiv.appendTo(container);
bodyDiv[0].scrollTop = scrollTop; bodyDiv[0].scrollTop = scrollTop;
var footerDiv = $('<div></div>').addClass("facet-footer").appendTo(container); var footerDiv = $('<div></div>').addClass("facet-footer").appendTo(container);