Do not reset pendingRemovals if event is dispatched again

This commit is contained in:
Andreas Hocevar
2016-03-08 15:54:51 +01:00
parent acd76a10b6
commit 8a279dd94b

View File

@@ -72,7 +72,9 @@ ol.events.EventTarget.prototype.dispatchEvent = function(event) {
var listeners = this.listeners_[type];
var propagate;
if (listeners) {
this.pendingRemovals_[type] = 0;
if (!(type in this.pendingRemovals_)) {
this.pendingRemovals_[type] = 0;
}
for (var i = 0, ii = listeners.length; i < ii; ++i) {
if (listeners[i].call(this, evt) === false || evt.propagationStopped) {
propagate = false;