By default, the click handler now has a zero pixelTolerance. This means we don't call click if the click includes a drag. Set pixelTolerance to null if you want click called with a drag. r=crschmidt (closes #1335)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6066 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-08 03:24:42 +00:00
parent fba4528c9a
commit 99f3fa0d26
3 changed files with 12 additions and 12 deletions

View File

@@ -45,12 +45,12 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
/**
* APIProperty: pixelTolerance
* {Number} Maximum number of pixels between mouseup and mousedown for an
* event to be considered a click. Default is null. If set to an
* event to be considered a click. Default is 0. If set to an
* integer value, clicks with a drag greater than the value will be
* ignored. This property can only be set when the handler is
* constructed.
*/
pixelTolerance: null,
pixelTolerance: 0,
/**
* APIProperty: stopSingle
@@ -182,7 +182,7 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
*/
passesTolerance: function(evt) {
var passes = true;
if(this.pixelTolerance && this.down) {
if(this.pixelTolerance != null && this.down) {
var dpx = Math.sqrt(
Math.pow(this.down.x - evt.xy.x, 2) +
Math.pow(this.down.y - evt.xy.y, 2)