Skip to content

Conversation

@ahocevar
Copy link
Member

The problem reported in #4919 is a regression caused by the goog.events.* removal. Listeners were always called synchronously, but the difference with the new implementation is that a once listener is unregistered after calling the listener, whereas it was unregistered before previously. The second problem is that when opt_this is not provided, we no longer bind to the event target by default.

Fixes #4919.

@ahocevar ahocevar changed the title Unlisten befor calling listener and bind to target by default Unlisten before calling listener and bind to target by default Feb 25, 2016
this.getSource().forEachFeature(function(feature) {
feature.setId(id++);
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this meant to be a test instead? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll be pushing an update shortly.

@ahocevar ahocevar force-pushed the unlisten-earlier-and-bind-to-target branch from bc844fb to 77ffe99 Compare February 25, 2016 16:47
@ahocevar
Copy link
Member Author

Tests added.

@ahocevar ahocevar force-pushed the unlisten-earlier-and-bind-to-target branch from 77ffe99 to 00a0f14 Compare February 25, 2016 16:48
@tschaub
Copy link
Member

tschaub commented Feb 25, 2016

Nice fix @ahocevar. Please merge.

ahocevar added a commit that referenced this pull request Feb 25, 2016
…arget

Unlisten before calling listener and bind to target by default
@ahocevar ahocevar merged commit 588dd54 into openlayers:master Feb 25, 2016
@ahocevar ahocevar deleted the unlisten-earlier-and-bind-to-target branch February 25, 2016 17:04
@ahocevar
Copy link
Member Author

Thanks for the quick review @tschaub.

ahocevar added a commit that referenced this pull request Mar 1, 2016
…arget

Unlisten before calling listener and bind to target by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants