Stopping double clicks on the panel control. Thanks for the patch sbenthall. r=me (closes #2069)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9594 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-07-29 04:20:57 +00:00
parent 1f3d495a12
commit 6f18a6abd0

View File

@@ -196,6 +196,8 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
}
OpenLayers.Event.observe(controls[i].panel_div, "click",
OpenLayers.Function.bind(this.onClick, this, controls[i]));
OpenLayers.Event.observe(controls[i].panel_div, "dblclick",
OpenLayers.Function.bind(this.onDoubleClick, this, controls[i]));
OpenLayers.Event.observe(controls[i].panel_div, "mousedown",
OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));
}
@@ -222,6 +224,13 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
this.activateControl(ctrl);
},
/**
* Method: onDoubleClick
*/
onDoubleClick: function(ctrl, evt) {
OpenLayers.Event.stop(evt ? evt : window.event);
},
/**
* APIMethod: getControlsBy
* Get a list of controls with properties matching the given criteria.