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