6ca2be41b8926eb8a41dee95d726a7aefd54adb9 tdreszer Wed Aug 24 10:17:59 2011 -0700 Against larry's advice, I did finish implementing the crosshair solution that QA requested. diff --git src/hg/js/jquery.imgareaselect.js src/hg/js/jquery.imgareaselect.js index 989ecec..3a1582f 100644 --- src/hg/js/jquery.imgareaselect.js +++ src/hg/js/jquery.imgareaselect.js @@ -325,44 +325,49 @@ if(selection.y1 >= options.clickClipHeight[i].top && selection.y1 < options.clickClipHeight[i].bottom) { found = true; } } } found = found || event.shiftKey; if(!found) { return false; } } resize = [ ]; update(); $a.add($o).show(); + $o.css('cursor', "crosshair"); // Outside of borders (needed for dragging right) + $a.css('cursor', "crosshair"); // Inside borders (needed for dragging left) jQuery(document).unbind('mouseup', cancelSelection) .mousemove(selectingMouseMove); $border2.unbind('mousemove', areaMouseMove); options.onSelectStart(img, selection); jQuery(document).one('mouseup', function (event) { selection.event = event; if (options.autoHide || (selection.width * selection.height == 0)) $a.add($o).hide(); options.onSelectEnd(img, selection); + //$o.css('cursor', ""); // Not even necessary + //$a.css('cursor', ""); + jQuery(document).unbind('mousemove', selectingMouseMove); $border2.mousemove(areaMouseMove); }); } function cancelSelection(event) { // The default behavior of imgareaselect is to cancel selection if the user let's go of the mouse before // moving it; we change the behavior so we can treat this as a single click, centering event. selection.event = event; jQuery(document).unbind('mousemove', startSelection); $a.add($o).hide(); selection.x1 = selection.x2 = selX(startX = x1 = x2 = evX(event)); selection.y1 = selection.y2 = selY(startY = y1 = y2 = evY(event));