07040f485bb7b6a1eb5f6202a32fc6107a508d1f tdreszer Wed Dec 15 14:59:40 2010 -0800 Fixed some sort issues. diff --git src/hg/js/utils.js src/hg/js/utils.js index 16254c8..b1e43a8 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -82,56 +82,41 @@ } } } 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 's must be id'd with 'tr_' + the checkbox id, // while checkbox id must have 'cb_' prefix (ie: 'tr_cb_checkThis' & 'cb_checkThis') - if (document.getElementsByTagName) - { - var list = document.getElementsByTagName('tr'); - for (var ix=0;ix= 0) { // marked as tr containing a cb - if(!onlySelected) { - tblRow.style.display = ''; //'table-row' doesn't work in some browsers (ie: IE) - } else { - var associated_cb = tblRow.id.substring(3,tblRow.id.length); - chkBox = document.getElementById(associated_cb); - if(chkBox!=undefined && chkBox.checked && chkBox.disabled == false) - tblRow.style.display = ''; + 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 - tblRow.style.display = 'none'; // hides - } - } - } - } - else if (document.all) { - if(debug) - alert("showSubTrackCheckBoxes is unimplemented for this browser"); - } else { - // NS 4.x - I gave up trying to get this to work. - if(debug) - alert("showSubTrackCheckBoxes is unimplemented for this browser"); + $(this).hide(); + }); } } function hideOrShowSubtrack(obj) { // This can show/hide a tablerow that contains a specific object // Containing 's must be id'd with 'tr_' + obj.id // Also, this relies upon the "displaySubtracks" radio button control var tblRow = document.getElementById("tr_"+obj.id); if(!obj.checked || obj.disabled) { var list = document.getElementsByName("displaySubtracks"); for (var ix=0;ix