f108a2c10a7cd4e62c837e549627bcbddf78a469 tdreszer Fri Jun 3 12:03:24 2011 -0700 Make use of ne class blueButtons to make draging groups more visually intuitive. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 3eb927c..3a99fb2 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -1328,33 +1328,39 @@ var imgTable = $(".tableWithDragAndDrop"); if($(imgTable).length > 0) { $(imgTable).tableDnD({ onDragClass: "trDrag", dragHandle: "dragHandle", scrollAmount: 40, onDragStart: function(ev, table, row) { saveMouseOffset(ev); $(document).bind('mousemove',blockTheMapOnMouseMove); // Can drag a contiguous set of rows if dragging blue button table.tableDnDConfig.dragObjects = [ row ]; // defaults to just the one var btn = $( row ).find('p.btnBlue'); // btnBlue means cursor over left button if (btn.length == 1) { table.tableDnDConfig.dragObjects = imgTblContiguousRowSet(row); + var compositeSet = imgTblCompositeSet(row); + if (compositeSet.length > 0) + $( compositeSet ).find('p.btn').addClass('blueButtons'); // blue persists } }, onDrop: function(table, row, dragStartIndex) { + var compositeSet = imgTblCompositeSet(row); + if (compositeSet.length > 0) + $( compositeSet ).find('p.btn').removeClass('blueButtons'); // blue persists if($(row).attr('rowIndex') != dragStartIndex) { // NOTE Even if dragging a contiguous set of rows, // still only need to check the one under the cursor. if(imgTblSetOrder) { imgTblSetOrder(table); } imgTblZipButtons( table ); } $(document).unbind('mousemove',blockTheMapOnMouseMove); setTimeout('blockUseMap=false;',50); // Necessary incase the onDrop was over a map item. onDrop takes precedence. } }); } if(imgBoxPortal) { //warn("imgBox("+imgBoxChromStart+"-"+imgBoxChromEnd+","+imgBoxWidth+") bases/pix:"+imgBoxBasesPerPixel+"\nportal("+imgBoxPortalStart+"-"+imgBoxPortalEnd+","+imgBoxPortalWidth+") offset:"+imgBoxPortalOffsetX);