[open-ils-commits] r15521 - trunk/Open-ILS/web/opac/common/js (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Feb 12 11:40:40 EST 2010
Author: miker
Date: 2010-02-12 11:40:37 -0500 (Fri, 12 Feb 2010)
New Revision: 15521
Modified:
trunk/Open-ILS/web/opac/common/js/opac_utils.js
Log:
Addressing https://bugs.launchpad.net/evergreen/+bug/520632
Modified: trunk/Open-ILS/web/opac/common/js/opac_utils.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/opac_utils.js 2010-02-12 16:24:21 UTC (rev 15520)
+++ trunk/Open-ILS/web/opac/common/js/opac_utils.js 2010-02-12 16:40:37 UTC (rev 15521)
@@ -88,7 +88,7 @@
path += "index.xml"; /* in case they go to / */
var page = null;
- for( var p in pages ) {
+ for( var p = 0; p < pages.length; p++ ) {
if( path.indexOf(pages[p]) != -1)
page = pages[p];
}
@@ -1018,8 +1018,11 @@
if(!isXUL() && !isTrue(org.opac_visible())) return;
insertSelectorVal( selector, -1,
org[namecol](), org.id(), null, findOrgDepth(org) - offset );
- for( var c in org.children() )
- buildOrgSel( selector, org.children()[c], offset, namecol);
+ var kids = org.children();
+ if (kids) {
+ for( var c = 0; c < kids.length; c++ )
+ buildOrgSel( selector, org.children()[c], offset, namecol);
+ }
}
function buildMergedOrgSel(selector, org_list, offset, namecol) {
@@ -1028,8 +1031,11 @@
var org = findOrgUnit(org_list[i]);
insertSelectorVal( selector, -1,
org[namecol](), org.id(), null, findOrgDepth(org) - offset );
- for( var c in org.children() )
- buildOrgSel( selector, org.children()[c], offset, namecol);
+ var kids = org.children();
+ if (kids) {
+ for( var c = 0; c < kids.length; c++ )
+ buildOrgSel( selector, org.children()[c], offset, namecol);
+ }
}
}
@@ -1063,7 +1069,8 @@
function isTrue(x) { return ( x && x != "0" && !(x+'').match(/^f$/i) ); }
function fetchPermOrgs() {
- var a = []; /* why does arguments come accross as an object and not an array? */
+ var a = []; /* Q: why does arguments come accross as an object and not an array? A: because arguments is a special object, a collection */
+
for( var i = 0; i < arguments.length; i++ )
a.push(arguments[i])
More information about the open-ils-commits
mailing list