Skip to content

fix unbind tooltip #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2019
Merged

fix unbind tooltip #386

merged 4 commits into from
May 15, 2019

Conversation

anhnhoktvn
Copy link
Contributor

No description provided.

@DonNicoJs
Copy link
Member

@anhnhoktvn thank you for the pr, we should use the same approach for popups. Could you update the pr?

@anhnhoktvn
Copy link
Contributor Author

Sure

@DonNicoJs
Copy link
Member

@anhnhoktvn hi thanks for the update. I was checking the source code but at the moment I am far from my pc for few days. I will review the pr again next week

@bezany
Copy link
Contributor

bezany commented May 6, 2019

@anhnhoktvn Hello! Thanks for you PR.
But I'm confused between the new code and the already existing code in the mixin Layer (unbindTooltip and unbindPopup). Look like it is same code.
Current code have any bug in this? Maybe try create unit test for control regression?

@anhnhoktvn
Copy link
Contributor Author

@bezany yes, I found a bug while using with rotated marker.
http://imgur.com/JLDjqDjl.png

@DonNicoJs
Copy link
Member

@anhnhoktvn Okay now I see the issue, rotated-marker is not one of our core components and do not implement the layer mixin. @bezany what do you think ? should we fix our side or should we ask the other plugin to import our layer mixin ?

@bezany
Copy link
Contributor

bezany commented May 8, 2019

@DonNicoJs Interesting case. Anyway, I think need done code more safe through added checks that this.parentContainer.unbindPopup exists.
And I think we can do additional checks for more stable works with plugins.
Can combine both versions of the code?
Like this:

if (this.parentContainer) {
	if (this.parentContainer.unbindPopup) {
		this.parentContainer.unbindPopup();
	} else if (this.parentContainer.mapObject
		&& this.parentContainer.mapObject.unbindPopup) {
		this.parentContainer.mapObject.unbindPopup();
	}
}

Not elegant, but reliable.

@anhnhoktvn
Copy link
Contributor Author

@DonNicoJs @bezany I updated the code following @bezany 's suggestion. Does anything need to be done?

@DonNicoJs
Copy link
Member

@anhnhoktvn no it's all good! Merging and thank you. I will do a release soon.

@DonNicoJs DonNicoJs merged commit a36d889 into vue-leaflet:master May 15, 2019
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.

3 participants