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

document Marker#getElement and add Popup#getElement #5242

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

mollymerp
Copy link
Contributor

per a question on stackoverflow, Marker#getElement was not documented, and I also noticed Popup did not have an equivalent function.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

src/ui/popup.js Outdated
getElement() {
return this._content ? this._content : null;

}
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 there's a a slight mismatch here between the element returned by getElement() -- which is the wrapping <div class="mapboxgl-popup-content">...</div> -- versus the element provided by, say, setDOMContent() / setHTML() / setText(), which would set the content of that div.

If someone does setHTML(<div class="my-popup">...</div>), they might reasonably expect to get the "my-popup" div back from getElement(). But since the the content provided by the setters need not be a single element, we can't use that as the return value for getElement(). Maybe the mismatch is fine, but we specify it in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah you're right @anandthakker – it is weird especially bc this will include the little close button we include by default 💭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing Popup portion of this PR – will revisit if we get user requests.

@mollymerp mollymerp merged commit 8a674b8 into master Sep 5, 2017
@mollymerp mollymerp deleted the document-getElement branch September 5, 2017 21:05
mollymerp added a commit that referenced this pull request Sep 5, 2017
anandthakker pushed a commit that referenced this pull request Sep 13, 2017
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