From: erickson Date: Mon, 29 Nov 2010 20:24:48 +0000 (+0000) Subject: prevent the allRecordsReceived event from firing multiple times in one page rendering X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=72220fc0e5cb7f9a5d19fbbac6dc53a882d1ae4f;p=evergreen%2Fbjwebb.git prevent the allRecordsReceived event from firing multiple times in one page rendering git-svn-id: svn://svn.open-ils.org/ILS/trunk@18863 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/skin/default/js/mresult.js b/Open-ILS/web/opac/skin/default/js/mresult.js index 726f58957..c6a2e4765 100644 --- a/Open-ILS/web/opac/skin/default/js/mresult.js +++ b/Open-ILS/web/opac/skin/default/js/mresult.js @@ -79,6 +79,7 @@ function mresultSetRecords(idstruct) { +var recsReceivedCalled = false; function mresultCollectRecords() { if(getHitCount() > 0 ) runEvt("result", "preCollectRecords"); var i = 0; @@ -95,7 +96,8 @@ function mresultCollectRecords() { req.request.abortCallback( function(){ recordsHandled++; - if(resultPageIsDone()) { + if(resultPageIsDone() && !recsReceivedCalled) { + recsReceivedCalled = true; runEvt('result', 'allRecordsReceived', recordsCache); unHideMe($('copyright_block')); } diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js index 30bbbe593..0fa0ba39b 100644 --- a/Open-ILS/web/opac/skin/default/js/rresult.js +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -285,11 +285,13 @@ function rresultCollectRecords(ids, base) { } +var recsReceivedCalled = false; function rresultHandleMods(r) { var rec = r.getResultObject(); runEvt('result', 'recordReceived', rec, r.userdata, false); resultCollectCopyCounts(rec, r.userdata, FETCH_R_COPY_COUNTS); - if(resultPageIsDone()) { + if(resultPageIsDone() && !recsReceivedCalled) { + recsReceivedCalled = true; runEvt('result', 'allRecordsReceived', recordsCache); unHideMe($('copyright_block')); }