fix for #624 - merge stop() and safeStopPropagation()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2994 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -66,18 +66,28 @@ OpenLayers.Event = {
|
||||
((event.button) && (event.button == 1)));
|
||||
},
|
||||
|
||||
/** Stops an event from propagating. If the event's 'preventDefault'
|
||||
* property is set, then we prevent the default browser behaviour
|
||||
* (such as text selection, radio-button clicking, etc) from occurring
|
||||
/** Stops an event from propagating.
|
||||
*
|
||||
* @param {Event} event
|
||||
* @param {Boolean} allowDefault If true, we stop the event chain but
|
||||
* still allow the default browser
|
||||
* behaviour (text selection, radio-button
|
||||
* clicking, etc)
|
||||
* Default false
|
||||
*/
|
||||
stop: function(event) {
|
||||
if (event.preventDefault) {
|
||||
event.preventDefault();
|
||||
stop: function(event, allowDefault) {
|
||||
|
||||
if (!allowDefault) {
|
||||
if (event.preventDefault) {
|
||||
event.preventDefault();
|
||||
} else {
|
||||
event.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.returnValue = false;
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
},
|
||||
@@ -504,7 +514,7 @@ OpenLayers.Events.prototype = {
|
||||
}
|
||||
// don't fall through to other DOM elements
|
||||
if (!this.fallThrough) {
|
||||
OpenLayers.Util.safeStopPropagation(evt);
|
||||
OpenLayers.Event.stop(evt, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user