Merge pull request #3908 from danzel/popup-movement

bringToFront / bringToBack for popups.
This commit is contained in:
Vladimir Agafonkin 2015-10-09 00:22:51 +03:00
commit ec714a76f3
2 changed files with 17 additions and 1 deletions

View File

@ -5,7 +5,9 @@ Leaflet Changelog
## 1.0-dev (master)
An in-progress version being developed on the `master` branch. No changes since the last tagged release yet.
An in-progress version being developed on the `master` branch.
* Added `bringToFront` and `bringToBack` to popups (by [@danzel](https://github.com/danzel)). [#3908](https://github.com/Leaflet/Leaflet/pull/3908) [#3307](https://github.com/Leaflet/Leaflet/issues/3813)
## 1.0-beta1 (July 14, 2015)

View File

@ -143,6 +143,20 @@ L.Popup = L.Layer.extend({
return !!this._map && this._map.hasLayer(this);
},
bringToFront: function () {
if (this._map) {
L.DomUtil.toFront(this._container);
}
return this;
},
bringToBack: function () {
if (this._map) {
L.DomUtil.toBack(this._container);
}
return this;
},
_close: function () {
if (this._map) {
this._map.closePopup(this);