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

[DOCS] Update Popup maxWidth description #8312

Merged
merged 2 commits into from
Jun 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/ui/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export type PopupOptions = {
* - an object of {@link Point}s specifing an offset for each anchor position
* Negative offsets indicate left and up.
* @param {string} [options.className] Space-separated CSS class names to add to popup container
* @param {string} [options.maxWidth] A string that sets the CSS property of the popup's maxWidth in pixels, eg "300px"
* @param {string} [options.maxWidth='240px'] -
* A string that sets the CSS property of the popup's maximum width, eg `'300px'`.
* If you want a fluid container which sizes to the inner size, you can set this property to `'none'`.
viniciuskneves marked this conversation as resolved.
Show resolved Hide resolved
* All available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
viniciuskneves marked this conversation as resolved.
Show resolved Hide resolved
* @example
* var markerHeight = 50, markerRadius = 10, linearOffset = 25;
* var popupOffsets = {
Expand Down Expand Up @@ -236,18 +239,19 @@ export default class Popup extends Evented {
}

/**
* Returns the popup's max width.
* Returns the popup's maximum width.
*
* @returns {string} The max width of the popup.
* @returns {string} The maximum width of the popup.
*/
getMaxWidth() {
return this._container.style.maxWidth;
}

/**
* Sets the popup's max width. This is setting the CSS property maxWidth. It expects a string in "Npx" format, where N is some number.
* Sets the popup's maximum width. This is setting the CSS property `max-width`.
* Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
*
* @param maxWidth A string representing the pixel value for the maximum width.
* @param maxWidth A string representing the value for the maximum width.
* @returns {Popup} `this`
*/
setMaxWidth(maxWidth: string) {
Expand Down