497d85f0a8f8ca48592955b0edd40468305a5be3 tdreszer Tue Sep 27 17:08:37 2011 -0700 Major rework of subCfg module to no longer rely upon removing name at initialization. diff --git src/hg/js/utils.js src/hg/js/utils.js index e6a8d24..096efa3 100644 --- src/hg/js/utils.js +++ src/hg/js/utils.js @@ -1518,31 +1518,36 @@ } function hintOverSortableColumnHeader(th) // NOT USED {// Upodates the sortColumns struct and sorts the table when a column headder has been pressed //th.title = "Click to make this the primary sort column, or toggle direction"; //var tr=th.parentNode; //th.title = "Current Sort Order: " + sortOrderFromTr(tr); } function tableSetPositions(table) {// Sets the value for the input.trPos of a table row. Typically this is a "priority" for a track // This gets called by sort or dragAndDrop in order to allow the new order to affect hgTracks display var inputs = $(table).find("input.trPos"); $( inputs ).each( function(i) { var tr = $( this ).closest('tr')[0]; - $( this ).val( $(tr).attr('rowIndex') ); + var trIx = $( tr ).attr('rowIndex').toString(); + if ($( this ).val() != trIx) { + $( this ).val( trIx ); + if (typeof(subCfg) !== "undefined") // NOTE: couldn't get $(this).change() to work. + subCfg.markChange(null,this); // probably because this is input type=hidden! + } }); } ///// Following functions are for Sorting by priority function trFindPosition(tr) { // returns the position (*.priority) of a sortable table row var inp = $(tr).find('input.trPos')[0]; if (inp) return $(inp).val(); return 999999; } function trComparePriority(tr1,tr2) // UNUSED FUNCTION {