added some sanity checks to accomodate IE
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jun 2006 17:49:34 +0000 (17:49 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jun 2006 17:49:34 +0000 (17:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4752 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index cae68b4..412b97e 100644 (file)
@@ -6,21 +6,20 @@ var lowHitCount = 4;
 var resultFetchAllRecords = false;
 
 /* set up the event handlers */
-G.evt.result.hitCountReceived.push(resultSetHitInfo);
-G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
-G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
-G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects, resultDrawAuthors, resultDrawSeries);
-//G.evt.result.allRecordsReceived.push(resultBuildCaches );
-
-attachEvt('result','lowHits',resultLowHits);
-attachEvt('result','zeroHits',resultZeroHits);
+if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
+       G.evt.result.hitCountReceived.push(resultSetHitInfo);
+       G.evt.result.recordReceived.push(resultDisplayRecord, resultAddCopyCounts);
+       G.evt.result.copyCountsReceived.push(resultDisplayCopyCounts);
+       G.evt.result.allRecordsReceived.push(resultBuildCaches, resultDrawSubjects, resultDrawAuthors, resultDrawSeries);
+       attachEvt('result','lowHits',resultLowHits);
+       attachEvt('result','zeroHits',resultZeroHits);
+       attachEvt( "common", "locationUpdated", resultSBSubmit );
+       /* do this after we have ID's so the rank for mr pages will be correct */
+       attachEvt("result", "preCollectRecords", resultPaginate);
+}
 
-attachEvt( "common", "locationUpdated", resultSBSubmit );
 function resultSBSubmit(){searchBarSubmit();}
 
-/* do this after we have ID's so the rank for mr pages will be correct */
-attachEvt("result", "preCollectRecords", resultPaginate);
-
 /* returns the last 'index' postion ocurring in this page */
 function resultFinalPageIndex() {
        if(getHitCount() < (getOffset() + getDisplayCount())) 
@@ -31,7 +30,6 @@ function resultFinalPageIndex() {
 
 
 
-
 /* generic search method */
 function resultCollectSearchIds( type, method, handler ) {
 
index 7011fe3..d8b02e3 100644 (file)
@@ -20,8 +20,10 @@ function rresultDoSearch() {
 
        table = G.ui.result.main_table;
        hideMe(G.ui.result.row_template);
-       while( table.parentNode.rows.length <= (getDisplayCount() +1) ) 
-               hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true)));
+       if( table && table.parentNode ) {
+               while( table.parentNode.rows.length <= (getDisplayCount() +1) ) 
+                       hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true)));
+       }
        rresultCollectIds();
 }
 
@@ -323,3 +325,4 @@ function rresultFilterSearchResults(r) {
 }
 
 
+