var resultFetchAllRecords = false;
var resultCompiledSearch = null;
+var allRecordsReceivedAndProcessed = false;
/* set up the event handlers */
if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects,
resultDrawAuthors, resultDrawSeries, function(){unHideMe($('result_info_2'))},
- fetchGoogleBooksLink);
+ fetchGoogleBooksLink, function() { allRecordsReceivedAndProcessed = true; });
attachEvt('result','lowHits',resultLowHits);
attachEvt('result','zeroHits',resultZeroHits);
}
function fetchGoogleBooksLink () {
+ if (allRecordsReceivedAndProcessed) { return; }
+
if (isbnList && googleBooksLink) {
var scriptElement = document.createElement("script");
scriptElement.setAttribute("id", "jsonScript");
var seriesCache = {};
function resultBuildCaches(records) {
+ if (allRecordsReceivedAndProcessed) { return; }
+
for( var r in records ) {
var rec = records[r];
for( var s in rec.subject() )
function resultSortSubjects(a, b) { return -(a.count - b.count); } /* sort in reverse */
function resultDrawSubjects() {
+ if (allRecordsReceivedAndProcessed) { return; }
var subjs = [];
for( var s in subjectCache )
}
function resultDrawAuthors() {
+ if (allRecordsReceivedAndProcessed) { return; }
+
var auths = new Array();
for( var s in authorCache ) auths.push(s);
}
function resultDrawSeries() {
+ if (allRecordsReceivedAndProcessed) { return; }
+
var sers = new Array();
for( var s in seriesCache ) sers.push(s);
resultDrawSidebarTrees(