dc12d7fd1157d99004e2a2fb2cf4090fbc47939a tdreszer Wed Jun 11 16:27:02 2014 -0700 Backing out several of the previous 'tightening screws' changes. In particular typeof(thing.var) !== 'undefined' if thing.var === null. I thought I tested this eariler, but now it is breaking sortTable, as reported by QA. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 1109f22..708398c 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1420,69 +1420,69 @@ if (altColors) { // lastMatch and lastBlue or not lastMatch and notLastBlue lastBlue = (lastMatchesLast === lastBlue); if (lastBlue) // Too smart by 1/3rd $( lastBtn ).addClass( 'btnBlue' ); else $( lastBtn ).removeClass( 'btnBlue' ); } count++; } //warn("Zipped "+count+" buttons "+countN+" are independent."); }, dragHandleMouseOver: function () { // Highlights a single row when mouse over a dragHandle column (sideLabel and buttons) - if ( typeof(jQuery.tableDnD) === 'undefined' ) { + if ( ! jQuery.tableDnD ) { //var handle = $("td.dragHandle"); //$(handle) // .unbind('mouseenter')//, jQuery.tableDnD.mousemove); // .unbind('mouseleave');//, jQuery.tableDnD.mouseup); return; } - if ( jQuery.tableDnD.dragObject === null ) { + if ( ! jQuery.tableDnD.dragObject ) { $( this ).parents("tr.trDraggable").addClass("trDrag"); } }, dragHandleMouseOut: function () { // Ends row highlighting by mouse over $( this ).parents("tr.trDraggable").removeClass("trDrag"); }, buttonMouseOver: function () { // Highlights a composite set of buttons, regarless of whether tracks are adjacent - if ( typeof(jQuery.tableDnD) === 'undefined' || jQuery.tableDnD.dragObject === null ) { + if ( ! jQuery.tableDnD || ! jQuery.tableDnD.dragObject ) { var classList = $( this ).attr("class").split(" "); var btns = $( "p." + classList[0] ); $( btns ).removeClass('btnGrey'); $( btns ).addClass('btnBlue'); - if (typeof(jQuery.tableDnD) !== 'undefined') { + if (jQuery.tableDnD) { var rows = dragReorder.getContiguousRowSet($(this).parents('tr.trDraggable')[0]); if (rows) $( rows ).addClass("trDrag"); } } }, buttonMouseOut: function () { // Ends composite highlighting by mouse over var classList = $( this ).attr("class").split(" "); var btns = $( "p." + classList[0] ); $( btns ).removeClass('btnBlue'); $( btns ).addClass('btnGrey'); - if (typeof(jQuery.tableDnD) !== 'undefined') { + if (jQuery.tableDnD) { var rows = dragReorder.getContiguousRowSet($(this).parents('tr.trDraggable')[0]); if (rows) $( rows ).removeClass("trDrag"); } }, trMouseOver: function (e) { // Trying to make sure there is always a imageV2.lastTrack so that we know where we are var id = ''; var a = /tr_(.*)/.exec($(this).attr('id')); // voodoo if (a && a[1]) { id = a[1]; } if (id.length > 0) { if ( ! imageV2.lastTrack || imageV2.lastTrack.id !== id) @@ -1900,31 +1900,31 @@ /////////////////////////////////////// //// rightClick (aka context menu) //// /////////////////////////////////////// var rightClick = { menu: null, selectedMenuItem: null, // currently choosen context menu item (via context menu). floatingMenuItem: null, currentMapItem: null, supportZoomCodon: false, // turns on experimental feature (currently only in larry's tree). makeMapItem: function (id) { // Create a dummy mapItem on the fly // (for objects that don't have corresponding entry in the map). - if (id && id.length > 0 && typeof(hgTracks.trackDb) !== 'undefined') { + if (id && id.length > 0 && hgTracks.trackDb) { var title; var rec = hgTracks.trackDb[id]; if (rec) { title = rec.shortLabel; } else { title = id; } return {id: id, title: "configure " + title}; } else { return null; } }, findMapItem: function (e) { // Find mapItem for given event; returns item object or null if none found.