From 822d42277c2a226ddd791eca18f76dd15634bed5 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 25 Jul 2007 14:44:12 +0000 Subject: [PATCH] backporting callnumber sort fix: svn merge -r7579:7580 svn://svn.open-ils.org/ILS/trunk 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 066d3fdbba..a2c2d0651c 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -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"); -- 2.11.0