From: Dan Wells Date: Thu, 2 Jun 2011 14:17:07 +0000 (-0400) Subject: Tweak MFHD scoping X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c7e7477079bfde1dfe00efe2cfc8ebdc0c457020;p=contrib%2FConifer.git Tweak MFHD scoping Three changes: 1) Add a closure for 'entryNum' value (currently used for some display placement and menu-entry correlation) 2) Remove depth-climb to simplify code and better approximate copy scoping 3) Move 'here' assignment out of the foreach Signed-off-by: Dan Wells Signed-off-by: Dan Scott --- diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 95afd73825..cbbc802708 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -275,14 +275,12 @@ function _holdingsDraw(h) { if (!holdings) { return null; } // Only draw holdings within our OU scope + var here = findOrgUnit(getLocation()); + var entryNum = 0; dojo.forEach(holdings, function (item) { - var here = findOrgUnit(getLocation()); - if (getDepth() > 0 || getDepth === 0 ) { - while (getDepth() < findOrgDepth(here)) - here = findOrgUnit( here.parent_ou() ); - if (orgIsMine(findOrgUnit(here), findOrgUnit(item.owning_lib()))) { - _holdingsDrawMFHD(item); - } + if (orgIsMine(here, findOrgUnit(item.owning_lib()))) { + _holdingsDrawMFHD(item, entryNum); + entryNum++; } });