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=d54a9c8d6b0e3c4bc2503420c1e054693058e3e0;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 2e92d0e4f6..b9d1cd6d2e 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -355,14 +355,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++; } });