Prevent click event when dragging in Handler.Drag. Fixes #656.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3082 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-04-17 18:25:04 +00:00
parent e93aa40e2c
commit 7a3eabceeb

View File

@@ -93,7 +93,6 @@ OpenLayers.Handler.Drag.prototype = OpenLayers.Class.inherit( OpenLayers.Handler
mouseup: function (evt) {
if (this.started) {
this.started = false;
this.dragging = false;
// TBD replace with CSS classes
this.map.div.style.cursor = "";
this.callback("up", [evt.xy]);
@@ -132,8 +131,8 @@ OpenLayers.Handler.Drag.prototype = OpenLayers.Class.inherit( OpenLayers.Handler
*/
click: function (evt) {
// throw away the first left click event that happens after a mouse up
if (OpenLayers.Event.isLeftClick(evt) && this.dragging) {
this.dragging = true;
if (this.dragging) {
this.dragging = false;
return false;
}
this.started = false;