Applied similar change to r769 to MouseDefaults.js.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@770 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -6,5 +6,9 @@ Philip Lindsay
|
|||||||
John Frank
|
John Frank
|
||||||
Schuyler Erle
|
Schuyler Erle
|
||||||
|
|
||||||
|
Patch contributors
|
||||||
|
------------------
|
||||||
|
Corey Puffault
|
||||||
|
|
||||||
OpenLayers is graciously supported by MetaCarta, Inc.
|
OpenLayers is graciously supported by MetaCarta, Inc.
|
||||||
<http://www.metacarta.com>.
|
<http://www.metacarta.com>.
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultClick: function (evt) {
|
defaultClick: function (evt) {
|
||||||
|
if (!Event.isLeftClick(evt)) return;
|
||||||
var notAfterDrag = !this.performedDrag;
|
var notAfterDrag = !this.performedDrag;
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
return notAfterDrag;
|
return notAfterDrag;
|
||||||
@@ -39,6 +40,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseDown: function (evt) {
|
defaultMouseDown: function (evt) {
|
||||||
|
if (!Event.isLeftClick(evt)) return;
|
||||||
this.mouseDragStart = evt.xy.copyOf();
|
this.mouseDragStart = evt.xy.copyOf();
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
if (evt.shiftKey) {
|
if (evt.shiftKey) {
|
||||||
@@ -94,6 +96,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseUp: function (evt) {
|
defaultMouseUp: function (evt) {
|
||||||
|
if (!Event.isLeftClick(evt)) return;
|
||||||
if (this.zoomBox) {
|
if (this.zoomBox) {
|
||||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
|
|
||||||
btn.events = new OpenLayers.Events(this, btn);
|
btn.events = new OpenLayers.Events(this, btn);
|
||||||
btn.events.register("mousedown", this, this.buttonClick);
|
btn.events.register("mousedown", this, this.buttonClick);
|
||||||
btn.events.register("mouseup", this, this.stopAction);
|
btn.events.register("mouseup", this, Event.stop);
|
||||||
btn.action = id;
|
btn.action = id;
|
||||||
btn.title = title;
|
btn.title = title;
|
||||||
btn.alt = title;
|
btn.alt = title;
|
||||||
@@ -74,11 +74,8 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
return btn;
|
return btn;
|
||||||
},
|
},
|
||||||
|
|
||||||
stopAction: function(evt) {
|
|
||||||
Event.stop(evt);
|
|
||||||
},
|
|
||||||
|
|
||||||
buttonClick: function(evt) {
|
buttonClick: function(evt) {
|
||||||
|
if (!Event.isLeftClick(evt)) return;
|
||||||
this.switchModeTo(evt.div.action);
|
this.switchModeTo(evt.div.action);
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user