backporting callnumber sort fix: svn merge -r7579:7580 svn://svn.open-ils.org/ILS...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Jul 2007 14:44:12 +0000 (14:44 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 25 Jul 2007 14:44:12 +0000 (14:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7581 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 066d3fd..a2c2d06 100644 (file)
@@ -572,14 +572,22 @@ function _rdetailBuildInfoRows(r) {
 
                if(rowNode.getAttribute("used")) {
 
-                       if( rowNode.nextSibling )
-                               rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), rowNode.nextSibling);
-                       else
+                       if( rowNode.nextSibling ) {
+                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) ) {
+                    sib = sib.nextSibling;
+                }
+                               rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+            } else {
                                rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
+            }
+
                        var n = findNodeByName( rowNode, config.names.rdetail.lib_cell );
                        n.appendChild(text(thisOrg.name()));
                        n.setAttribute("style", "padding-left: " + ((findOrgDepth(thisOrg) - 1)  * 9) + "px;");
-                       rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr); //
+                       rowNode.id = "cp_info_" + thisOrg.id() + '_' + (++ctr); 
 
                } else {
                        rowNode.setAttribute("used", "1");