update default behaviour of popups. now you can click and drag inside a popup without the events dropping through to the map, yet if you are dragging a zoombox over a popup, it still responds. this is all thanks to a new function i am adding to Util.js which is called OpenLayers.Util.safeStopPropagaition(). Turns out the default Event.stop() from prototype.js is also calling a function called preventDefault() which disallows things like selecting text or clicking a hyperlink. all tests pass.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1438 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -516,3 +516,16 @@ OpenLayers.Util.getResolutionFromScale = function (scale, units) {
|
||||
* OpenLayers.DOTS_PER_INCH);
|
||||
return resolution;
|
||||
};
|
||||
|
||||
/** Safely stop the propagation of an event *without* preventing
|
||||
* the default browser action from occurring.
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
OpenLayers.Util.safeStopPropagation = function(evt) {
|
||||
if (evt.stopPropagation) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
evt.returnValue = false;
|
||||
evt.cancelBubble = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user