[open-ils-commits] r8512 - branches/rel_1_2_1/Open-ILS/web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 28 10:36:23 EST 2008


Author: erickson
Date: 2008-01-28 10:09:11 -0500 (Mon, 28 Jan 2008)
New Revision: 8512

Modified:
   branches/rel_1_2_1/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
protecting against edge case where we run off the end of the org table before finding a place to insert the callnumber row

Modified: branches/rel_1_2_1/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- branches/rel_1_2_1/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 15:08:20 UTC (rev 8511)
+++ branches/rel_1_2_1/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 15:09:11 UTC (rev 8512)
@@ -576,10 +576,13 @@
                 sib = rowNode.nextSibling;
                 o ='cp_info_'+thisOrg.id()+'_';
                 /* push the new row on as the last row for this org unit */
-                while( sib.id.match(o) ) {
+                while( sib && sib.id.match(o) ) {
                     sib = sib.nextSibling;
                 }
-				rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                if(sib)
+				    rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                else
+                    rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             } else {
 				rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             }



More information about the open-ils-commits mailing list