git-svn-id: http://svn.openlayers.org/trunk/openlayers@855 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-07-03 00:06:28 +00:00
parent c776967e66
commit e34d5e2e96

View File

@@ -1,17 +1,29 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Control.js
/**
* @class
*/
OpenLayers.Control.MouseDefaults = Class.create();
OpenLayers.Control.MouseDefaults.prototype =
Object.extend( new OpenLayers.Control(), {
/** @type Boolean */
performedDrag: false,
/**
* @constructor
*/
initialize: function() {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
*
*/
draw: function() {
this.map.events.register( "click", this, this.defaultClick );
this.map.events.register( "dblclick", this, this.defaultDblClick );
@@ -21,6 +33,11 @@ OpenLayers.Control.MouseDefaults.prototype =
this.map.events.register( "mouseout", this, this.defaultMouseOut );
},
/**
* @param {Event} evt
*
* @type Boolean
*/
defaultClick: function (evt) {
if (!Event.isLeftClick(evt)) return;
var notAfterDrag = !this.performedDrag;
@@ -120,6 +137,9 @@ OpenLayers.Control.MouseDefaults.prototype =
this.map.div.style.cursor = "default";
},
/**
* @param {Event} evt
*/
defaultMouseOut: function (evt) {
if (this.mouseDragStart != null
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {