using opac event to fetch the google data once
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Mar 2008 19:12:38 +0000 (19:12 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 14 Mar 2008 19:12:38 +0000 (19:12 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9018 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/skin/default/js/result_common.js

index 8d9009a..a9d5b38 100644 (file)
@@ -14,7 +14,9 @@ if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
        G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
        G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
        G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects, 
-      resultDrawAuthors, resultDrawSeries, function(){unHideMe($('result_info_2'))});
+      resultDrawAuthors, resultDrawSeries, function(){unHideMe($('result_info_2'))},
+         fetchGoogleBooks);
+
        attachEvt('result','lowHits',resultLowHits);
        attachEvt('result','zeroHits',resultZeroHits);
        attachEvt( "common", "locationUpdated", resultSBSubmit );
@@ -578,9 +580,7 @@ function resultBuildFormatIcons( row, rec, is_mr ) {
        }
 }
 
-
-function resultPageIsDone(pos) {
-
+function fetchGoogleBooks () {
     if (isbnList && googleBooks) {
         var scriptElement = document.createElement("script");
         scriptElement.setAttribute("id", "jsonScript");
@@ -591,6 +591,9 @@ function resultPageIsDone(pos) {
         // make the request to Google Book Search
         document.documentElement.firstChild.appendChild(scriptElement);
     }
+}
+
+function resultPageIsDone(pos) {
 
        return (recordsHandled == getDisplayCount() 
                || recordsHandled + getOffset() == getHitCount());