7f39a66dca865c28f279e2b43211772e53bfa722 tdreszer Fri Sep 23 23:23:32 2011 -0700 Tightened a few more screws on subCfg diff --git src/hg/js/utils.js src/hg/js/utils.js index 949d48e..e6a8d24 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -76,81 +76,41 @@ } } } if(!failed) { found[fIx] = ele; fIx++; } } } else { // NS 4.x - I gave up trying to get this to work. if(debugLevel>2) alert("arrayOfInputsThatMatch is unimplemented for this browser"); } return found; } -function showSubTrackCheckBoxes(onlySelected) -{ -// If a Subtrack configuration page has show "only selected subtracks" option, -// This can show/hide tablerows that contain the checkboxes -// Containing <tr>'s must be id'd with 'tr_' + the checkbox id, -// while checkbox id must have 'cb_' prefix (ie: 'tr_cb_checkThis' & 'cb_checkThis') - var trs = $('table.subtracks').children('tbody').children('tr'); - if(!onlySelected) - $(trs).show(); - else { - $(trs).each(function (ix) { - var subCB = $(this).find('input.subCB'); - if (subCB.length > 0 && subCB[0].checked && subCB[0].disabled == false) - $(this).show(); - else - $(this).hide(); - }); - } -} + function normed(obj) { // returns undefined, the obj or the obj normalized from one member array if (obj == undefined || obj == null || obj.length == 0) return undefined; if (obj.length == 1) return obj[0]; return obj; // (obj.length > 1) } -function hideOrShowSubtrack(obj) -{ -// This can show/hide a tablerow that contains a specific object -// Containing <tr>'s must be id'd with 'tr_' + obj.id -// Also, this relies upon the "displaySubtracks" radio button control - var tr = $(obj).parents('tr#tr_'+obj.id); - if (tr != undefined && tr.length == 1) { - tr = tr[0]; - - if(!obj.checked || obj.disabled) { - var radio = $('input.allOrOnly'); - for (var ix=0;ix<radio.length;ix++) { - if(radio[ix].checked && radio[ix].value == "selected") { - $(tr).hide(); - return; - } - } - } - $(tr).show(); - } -} - function waitCursor(obj) { //document.body.style.cursor="wait" obj.style.cursor="wait"; } function endWaitCursor(obj) { obj.style.cursor=""; } function getURLParam() { // Retrieve variable value from an url. // Can be called either: