Return false from DoubleClick and Click events in controls so that these events don't filter through and hit the onclick handlers that we might register on the map.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@572 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -115,6 +115,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
|||||||
*/
|
*/
|
||||||
doubleClick: function(evt) {
|
doubleClick: function(evt) {
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,6 +145,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
|||||||
backdropLabel.layer = layer;
|
backdropLabel.layer = layer;
|
||||||
|
|
||||||
// set event handlers
|
// set event handlers
|
||||||
|
backdropLabelOuter.onclick = this.doubleClick.bindAsEventListener(this);
|
||||||
backdropLabelOuter.ondblclick = this.doubleClick.bindAsEventListener(this);
|
backdropLabelOuter.ondblclick = this.doubleClick.bindAsEventListener(this);
|
||||||
backdropLabelOuter.onmousedown = this.singleClick.bindAsEventListener(this);
|
backdropLabelOuter.onmousedown = this.singleClick.bindAsEventListener(this);
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
|
|
||||||
btn.onmousedown = this.buttonDown.bindAsEventListener(btn);
|
btn.onmousedown = this.buttonDown.bindAsEventListener(btn);
|
||||||
btn.ondblclick = this.doubleClick.bindAsEventListener(btn);
|
btn.ondblclick = this.doubleClick.bindAsEventListener(btn);
|
||||||
|
btn.onclick = this.doubleClick.bindAsEventListener(btn);
|
||||||
btn.action = id;
|
btn.action = id;
|
||||||
btn.map = this.map;
|
btn.map = this.map;
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
|
|
||||||
doubleClick: function (evt) {
|
doubleClick: function (evt) {
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
buttonDown: function (evt) {
|
buttonDown: function (evt) {
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
||||||
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
||||||
this.sliderEvents.register("dblclick", this, this.doubleClick);
|
this.sliderEvents.register("dblclick", this, this.doubleClick);
|
||||||
|
this.sliderEvents.register("click", this, this.doubleClick);
|
||||||
|
|
||||||
sz = new OpenLayers.Size();
|
sz = new OpenLayers.Size();
|
||||||
sz.h = this.zoomStopHeight*(this.map.getZoomLevels()+1);
|
sz.h = this.zoomStopHeight*(this.map.getZoomLevels()+1);
|
||||||
@@ -96,6 +97,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
this.divEvents.register("mousedown", this, this.divClick);
|
this.divEvents.register("mousedown", this, this.divClick);
|
||||||
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
||||||
this.divEvents.register("dblclick", this, this.doubleClick);
|
this.divEvents.register("dblclick", this, this.doubleClick);
|
||||||
|
this.divEvents.register("click", this, this.doubleClick);
|
||||||
|
|
||||||
this.div.appendChild(div);
|
this.div.appendChild(div);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user