ea1adb539e0356930cce52e050e76aa25828f6c0 tdreszer Fri Jan 10 11:22:17 2014 -0800 Fixed hgTracks image track sorting bug reported in redmine #12455 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 75f8f22..b4b2af5 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1007,31 +1007,31 @@ // Do we need to sort? var trs = tbody.rows; var needToSort = false; $(trs).each(function(ix) { if ($(this).attr('abbr') != $(this).attr('rowIndex').toString()) { needToSort = true; return false; // break for each() loops } }); if (!needToSort) return false; // Create array of tr holders to sort var ary = new Array(); $(trs).each(function(ix) { // using sortTable found in utils.js - ary.push(new sortTable.field($(this).attr('abbr'),false,this)); + ary.push(new sortTable.field(parseInt($(this).attr('abbr')),false,this)); }); // Sort the array ary.sort(sortTable.fieldCmp); // most efficient reload of sorted rows I have found var sortedRows = jQuery.map(ary, function(ary, i) { return ary.row; }); $(tbody).append( sortedRows ); // removes tr from current position and adds to end. return true; }, showCenterLabel: function (tr, show) { // Will show or hide centerlabel as requested // adjust button, sideLabel height, sideLabelOffset and centerlabel display