Travese the interaction array in reverse order.

The interactions added via getInteractions().push(...) are evaluated
first.
This commit is contained in:
Frederic Junod
2012-10-03 14:37:59 +02:00
parent 67770c439a
commit e700ed99be

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;
}
}
}
};