From ed42290d0036a47a3130e8f95751c93396cf1b14 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 12 Feb 2010 17:21:43 +0000 Subject: [PATCH] Addressing https://bugs.launchpad.net/evergreen/+bug/520632 git-svn-id: svn://svn.open-ils.org/ILS/trunk@15524 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/rdetail.js | 30 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 2850235a7c..6bd7798cb8 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -393,7 +393,7 @@ function _rdetailDraw(r) { // Fill in our unAPI ID, if anyone cares var abbrs = document.getElementsByTagName('abbr'); var span; - for (var i = 0; i < abbrs.length; i = i + 1) { + for (var i = 0; i < abbrs.length; i++) { if (abbrs[i].getAttribute('name') == 'unapi') { span = abbrs[i]; break; @@ -473,7 +473,7 @@ function rdetailAddBookbags(r) { var index = 3; doSelectorActions(selector); - for( var i = 0; i != containers.length; i++ ) { + for( var i = 0; i < containers.length; i++ ) { found = true; var container = containers[i]; insertSelectorVal( selector, index++, container.name(), @@ -607,7 +607,7 @@ function rdetailBuildCNList() { return; } - for( var i in arr ) { + for( var i = 0; i < arr.length; i++ ) { var cn = arr[i]; var opt = new Option(cn); select.options[index++] = opt; @@ -673,7 +673,7 @@ function rdetailShowReviews(r) { var template = par.removeChild($('rdetail_review_template')); if( res && res.length > 0 ) { unHideMe($('rdetail_reviews_link')); - for( var i = 0; i != res.length; i++ ) { + for( var i = 0; i < res.length; i++ ) { var rev = res[i]; if( rev.text && rev.info ) { var node = template.cloneNode(true); @@ -716,12 +716,15 @@ function _rdetailRows(node) { if( node ) { if( !orgIsMine(node, loc) && !orgIsMine(loc,node) ) return; } else { - for( var i = 0; i < globalOrgTree.children().length; i++ ) { - var org = findOrgUnit(globalOrgTree.children()[i]); - if( orgIsMine(org, loc) ) { - node = org; - break; - } + var kids = globalOrgTree.children(); + if (kids) { + for( var i = 0; i < kids.length; i++ ) { + var org = findOrgUnit(kids[i]); + if( orgIsMine(org, loc) ) { + node = org; + break; + } + } } } } @@ -764,8 +767,11 @@ function _rdetailRows(node) { } else { node = globalOrgTree; } - for( var c in node.children() ) - _rdetailRows(node.children()[c]); + var kids = node.children(); + if (kids) { + for( var c = 0; c < kids.length; c++ ) + _rdetailRows(kids[c]); + } } function rdetailCNPrint(orgid, cn) { -- 2.11.0