Skip to content
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

Layer: refactor openPopup/openTooltip: use common function #6613

Merged
merged 2 commits into from Apr 30, 2019

Conversation

johnd0e
Copy link
Collaborator

@johnd0e johnd0e commented Apr 19, 2019

Layer: refactor openPopup/openTooltip: use common function DivOverlay._openOverlay.


This change is Reviewable

@johnd0e
Copy link
Collaborator Author

johnd0e commented Apr 19, 2019

Perhaps better name function differently, like _initOverlay.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Looks great! Re naming, maybe _updateOverlay would reflect what the code is doing best?

@johnd0e
Copy link
Collaborator Author

johnd0e commented Apr 22, 2019

maybe _updateOverlay would reflect what the code is doing best?

There are already several methods prefixed with update, so we need reflect function specific somehow

Besides, I do not feel that update is right word, as this code may be invoked before tooltip opened. It is a sort of preparatory step: here we determine what layer will be set as source, and calculate target latlng.

So may be _preOpen?

@mourner
Copy link
Member

mourner commented Apr 23, 2019

It is a sort of preparatory step

_prepareOpen then? or _prepareOverlay

@johnd0e johnd0e force-pushed the refactor-open-popup-tooltip branch from e224d83 to 7debbc9 Compare April 23, 2019 12:24
@johnd0e
Copy link
Collaborator Author

johnd0e commented Apr 23, 2019

_prepareOpen then? or _prepareOverlay

Ok, PR updated.

I've added one more commit, please check if it's acceptable.

Copy link
Sponsor Collaborator

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

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

👍

@cherniavskii cherniavskii merged commit 1e0d43b into Leaflet:master Apr 30, 2019
Schleuse pushed a commit to Schleuse/Leaflet that referenced this pull request Dec 3, 2019
)

* Layer: refactor openPopup/openTooltip: use common function DivOverlay._prepareOpen

* More clear error message when trying to attach popup/tooltip to layer
without getLatLng function
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.

None yet

3 participants