Skip to content

Commit

Permalink
Merge branch 'publisher-production' into mapbox-gl-geocoder@v4.4.0
Browse files Browse the repository at this point in the history
* publisher-production:
  [DOCS] Update Popup maxWidth description (#8312)
  • Loading branch information
Katy DeCorah committed Jun 13, 2019
2 parents 85cd655 + 16f7de5 commit 3fecf5f
Showing 1 changed file with 9 additions and 5 deletions.
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'`.
* To ensure the popup resizes to fit its content, set this property to `'none'`.
* Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
* @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

0 comments on commit 3fecf5f

Please sign in to comment.