[open-ils-commits] r16152 - 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:08:45 EDT 2010
Author: miker
Date: 2010-04-07 10:08:43 -0400 (Wed, 07 Apr 2010)
New Revision: 16152
Modified:
trunk/Open-ILS/web/opac/skin/default/js/holds.js
Log:
improve 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 07:11:23 UTC (rev 16151)
+++ trunk/Open-ILS/web/opac/skin/default/js/holds.js 2010-04-07 14:08:43 UTC (rev 16152)
@@ -576,14 +576,29 @@
var selector = $('hold_alt_form_selector');
+ for( var i = 0; i < selector.options.length; i++ ) {
+ if (selector.options[i].className.indexOf('hide_me') == -1)
+ hideMe(selector.options[i]);
+ }
+
for( var i = 0; i < avail_formats.length; i++ ) {
var form = avail_formats[i];
- var opt = findSelectorOptByValue(selector,form);
+ var opt = findFormatSelectorOptByParts(selector,form);
if(type=='M') opt.selected=true;
unHideMe(opt);
}
}
+function findFormatSelectorOptByParts( sel, val ) {
+ var parts = val.split('-');
+ for( var i = 0; i < sel.options.length; i++ ) {
+ 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;
+ }
+ return null;
+}
function holdsGetFormats() {
More information about the open-ils-commits
mailing list