[open-ils-commits] r16155 - trunk/Open-ILS/web/opac/skin/default/js (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Apr 7 10:55:16 EDT 2010


Author: miker
Date: 2010-04-07 10:55:14 -0400 (Wed, 07 Apr 2010)
New Revision: 16155

Modified:
   trunk/Open-ILS/web/opac/skin/default/js/holds.js
Log:
safer still metarecord constituent type/form matching

Modified: trunk/Open-ILS/web/opac/skin/default/js/holds.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/holds.js	2010-04-07 14:52:12 UTC (rev 16154)
+++ trunk/Open-ILS/web/opac/skin/default/js/holds.js	2010-04-07 14:55:14 UTC (rev 16155)
@@ -584,6 +584,7 @@
 	for( var i = 0; i < avail_formats.length; i++ ) {
 		var form = avail_formats[i];
 		var opt = findFormatSelectorOptByParts(selector,form);
+        if (!opt) continue;
 		if(type=='M') opt.selected=true;
 		unHideMe(opt);
 	}
@@ -595,7 +596,7 @@
         var opt = sel.options[i];
         var oval = opt.value;
         var oparts = oval.split('-');
-        if( oparts[0].indexOf(parts[0]) > -1 && ((!oparts[1] && !parts[1]) || (oparts[1].indexOf(parts[1]) > -1)) ) return opt;
+        if( oparts[0].indexOf(parts[0]) > -1 && (!parts[1] || oparts[1].indexOf(parts[1]) > -1) ) return opt;
     }
     return null;
 }
@@ -650,8 +651,7 @@
 function _t_f_2_format(type, form) {
 	if( (type == 'a' || type == 't') && form == 's' ) return 'at-s';
 	if( form == 'd' ) return 'at-d';
-	return (type == 'a' || type == 't') ? 'at' : 
-		( type == 'i' || type == 'g' || type == 'j' ) ? type : null;
+	return (type == 'a' || type == 't') ? 'at' : type;
 }
 
 function holdsSetSelectedFormats() {



More information about the open-ils-commits mailing list