* Fix popup "autoClose" and "closeOnClick" options documentation, fixes #5040 * Docstring for Popup `closeOnClick` option * Backticks on docstrings
This commit is contained in:
parent
fa458e7511
commit
59298a72d0
@ -2916,13 +2916,19 @@ off of the screen while it is open.</td>
|
|||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Controls the presence of a close button in the popup.</td>
|
<td>Controls the presence of a close button in the popup.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id='popup-closeonclick'>
|
||||||
|
<td><code><b>closeOnClick</b></code></td>
|
||||||
|
<td><code>Boolean</code>
|
||||||
|
<td><code>*</code></td>
|
||||||
|
<td>Set it if you want to override the default behavior of the popup closing when user clicks
|
||||||
|
on the map. Defaults to the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option.</td>
|
||||||
|
</tr>
|
||||||
<tr id='popup-autoclose'>
|
<tr id='popup-autoclose'>
|
||||||
<td><code><b>autoClose</b></code></td>
|
<td><code><b>autoClose</b></code></td>
|
||||||
<td><code>Boolean</code>
|
<td><code>Boolean</code>
|
||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Set it to <code>false</code> if you want to override the default behavior of
|
<td>Set it to <code>false</code> if you want to override the default behavior of
|
||||||
the popup closing when user clicks the map (set globally by
|
the popup closing when another popup is opened.</td>
|
||||||
the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option).</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr id='popup-classname'>
|
<tr id='popup-classname'>
|
||||||
<td><code><b>className</b></code></td>
|
<td><code><b>className</b></code></td>
|
||||||
|
@ -2958,13 +2958,19 @@ off of the screen while it is open.</td>
|
|||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Controls the presence of a close button in the popup.</td>
|
<td>Controls the presence of a close button in the popup.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id='popup-closeonclick'>
|
||||||
|
<td><code><b>closeOnClick</b></code></td>
|
||||||
|
<td><code>Boolean</code>
|
||||||
|
<td><code>*</code></td>
|
||||||
|
<td>Set it if you want to override the default behavior of the popup closing when user clicks
|
||||||
|
on the map. Defaults to the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option.</td>
|
||||||
|
</tr>
|
||||||
<tr id='popup-autoclose'>
|
<tr id='popup-autoclose'>
|
||||||
<td><code><b>autoClose</b></code></td>
|
<td><code><b>autoClose</b></code></td>
|
||||||
<td><code>Boolean</code>
|
<td><code>Boolean</code>
|
||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Set it to <code>false</code> if you want to override the default behavior of
|
<td>Set it to <code>false</code> if you want to override the default behavior of
|
||||||
the popup closing when user clicks the map (set globally by
|
the popup closing when another popup is opened.</td>
|
||||||
the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option).</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr id='popup-classname'>
|
<tr id='popup-classname'>
|
||||||
<td><code><b>className</b></code></td>
|
<td><code><b>className</b></code></td>
|
||||||
|
@ -2967,13 +2967,19 @@ off of the screen while it is open.</td>
|
|||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Controls the presence of a close button in the popup.</td>
|
<td>Controls the presence of a close button in the popup.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id='popup-closeonclick'>
|
||||||
|
<td><code><b>closeOnClick</b></code></td>
|
||||||
|
<td><code>Boolean</code>
|
||||||
|
<td><code>*</code></td>
|
||||||
|
<td>Set it if you want to override the default behavior of the popup closing when user clicks
|
||||||
|
on the map. Defaults to the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option.</td>
|
||||||
|
</tr>
|
||||||
<tr id='popup-autoclose'>
|
<tr id='popup-autoclose'>
|
||||||
<td><code><b>autoClose</b></code></td>
|
<td><code><b>autoClose</b></code></td>
|
||||||
<td><code>Boolean</code>
|
<td><code>Boolean</code>
|
||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Set it to <code>false</code> if you want to override the default behavior of
|
<td>Set it to <code>false</code> if you want to override the default behavior of
|
||||||
the popup closing when user clicks the map (set globally by
|
the popup closing when another popup is opened.</td>
|
||||||
the Map's <a href="#map-closepopuponclick">closePopupOnClick</a> option).</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr id='popup-classname'>
|
<tr id='popup-classname'>
|
||||||
<td><code><b>className</b></code></td>
|
<td><code><b>className</b></code></td>
|
||||||
|
@ -84,10 +84,13 @@ export var Popup = DivOverlay.extend({
|
|||||||
|
|
||||||
// @option autoClose: Boolean = true
|
// @option autoClose: Boolean = true
|
||||||
// Set it to `false` if you want to override the default behavior of
|
// Set it to `false` if you want to override the default behavior of
|
||||||
// the popup closing when user clicks the map (set globally by
|
// the popup closing when another popup is opened.
|
||||||
// the Map's [closePopupOnClick](#map-closepopuponclick) option).
|
|
||||||
autoClose: true,
|
autoClose: true,
|
||||||
|
|
||||||
|
// @option closeOnClick: Boolean = *
|
||||||
|
// Set it if you want to override the default behavior of the popup closing when user clicks
|
||||||
|
// on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.
|
||||||
|
|
||||||
// @option className: String = ''
|
// @option className: String = ''
|
||||||
// A custom CSS class name to assign to the popup.
|
// A custom CSS class name to assign to the popup.
|
||||||
className: ''
|
className: ''
|
||||||
@ -148,7 +151,7 @@ export var Popup = DivOverlay.extend({
|
|||||||
getEvents: function () {
|
getEvents: function () {
|
||||||
var events = DivOverlay.prototype.getEvents.call(this);
|
var events = DivOverlay.prototype.getEvents.call(this);
|
||||||
|
|
||||||
if ('closeOnClick' in this.options ? this.options.closeOnClick : this._map.options.closePopupOnClick) {
|
if (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {
|
||||||
events.preclick = this._close;
|
events.preclick = this._close;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user