Merge pull request #1960 from elemoine/stopevent

Implement shouldStopEvent in DragBox interaction
This commit is contained in:
Éric Lemoine
2014-04-07 17:23:46 +02:00
3 changed files with 12 additions and 9 deletions
+7
View File
@@ -6,6 +6,7 @@ goog.provide('ol.interaction.DragBox');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.events.Event'); goog.require('goog.events.Event');
goog.require('goog.functions');
goog.require('ol.events.ConditionType'); goog.require('ol.events.ConditionType');
goog.require('ol.events.condition'); goog.require('ol.events.condition');
goog.require('ol.interaction.Pointer'); goog.require('ol.interaction.Pointer');
@@ -192,3 +193,9 @@ ol.interaction.DragBox.prototype.handlePointerDown =
return false; return false;
} }
}; };
/**
* @inheritDoc
*/
ol.interaction.DragBox.prototype.shouldStopEvent = goog.functions.identity;
@@ -3,6 +3,7 @@
goog.provide('ol.interaction.DragRotateAndZoom'); goog.provide('ol.interaction.DragRotateAndZoom');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.functions');
goog.require('goog.math.Vec2'); goog.require('goog.math.Vec2');
goog.require('ol.ViewHint'); goog.require('ol.ViewHint');
goog.require('ol.events.ConditionType'); goog.require('ol.events.ConditionType');
@@ -153,11 +154,8 @@ ol.interaction.DragRotateAndZoom.prototype.handlePointerDown =
/** /**
* @inheritDoc * @inheritDoc
* Stop the event if it was handled, so that interaction `DragZoom`
* does not interfere.
*/ */
ol.interaction.DragRotateAndZoom.prototype.shouldStopEvent = ol.interaction.DragRotateAndZoom.prototype.shouldStopEvent =
function(hasHandledEvent) { goog.functions.identity;
/* Stop the event if it was handled, so that interaction `DragZoom`
* does not interfere.
*/
return hasHandledEvent;
};
+1 -3
View File
@@ -735,9 +735,7 @@ ol.interaction.Modify.prototype.removeVertex_ = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
ol.interaction.Modify.prototype.shouldStopEvent = function(handled) { ol.interaction.Modify.prototype.shouldStopEvent = goog.functions.identity;
return handled;
};
/** /**