Merge pull request #43 from fredj/interaction-traversal

Travese the interaction array in reverse order.
This commit is contained in:
Frédéric Junod
2012-10-03 08:58:13 -07:00

View File

@@ -605,10 +605,13 @@ ol.Map.prototype.handleMapBrowserEvent = function(mapBrowserEvent) {
var interactionsArray = /** @type {Array.<ol.interaction.Interaction>} */
interactions.getArray();
if (this.dispatchEvent(mapBrowserEvent) !== false) {
goog.array.every(interactionsArray, function(interaction) {
for (var i = interactionsArray.length - 1; i >= 0; i--) {
var interaction = interactionsArray[i];
interaction.handleMapBrowserEvent(mapBrowserEvent);
return !mapBrowserEvent.defaultPrevented;
});
if (mapBrowserEvent.defaultPrevented) {
break;
}
}
}
};