[open-ils-commits] r18863 - trunk/Open-ILS/web/opac/skin/default/js (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 29 15:24:53 EST 2010
Author: erickson
Date: 2010-11-29 15:24:48 -0500 (Mon, 29 Nov 2010)
New Revision: 18863
Modified:
trunk/Open-ILS/web/opac/skin/default/js/mresult.js
trunk/Open-ILS/web/opac/skin/default/js/rresult.js
Log:
prevent the allRecordsReceived event from firing multiple times in one page rendering
Modified: trunk/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2010-11-29 20:24:47 UTC (rev 18862)
+++ trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2010-11-29 20:24:48 UTC (rev 18863)
@@ -79,6 +79,7 @@
+var recsReceivedCalled = false;
function mresultCollectRecords() {
if(getHitCount() > 0 ) runEvt("result", "preCollectRecords");
var i = 0;
@@ -95,7 +96,8 @@
req.request.abortCallback(
function(){
recordsHandled++;
- if(resultPageIsDone()) {
+ if(resultPageIsDone() && !recsReceivedCalled) {
+ recsReceivedCalled = true;
runEvt('result', 'allRecordsReceived', recordsCache);
unHideMe($('copyright_block'));
}
Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2010-11-29 20:24:47 UTC (rev 18862)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2010-11-29 20:24:48 UTC (rev 18863)
@@ -285,11 +285,13 @@
}
+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'));
}
More information about the open-ils-commits
mailing list