From 6b43bc656690c662f9f5d2c1d51784c3939de29d Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 23 Dec 2013 12:47:02 +0200 Subject: [PATCH] fix Popup remove/add sequence --- src/layer/Popup.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layer/Popup.js b/src/layer/Popup.js index c2aa28e8..160f7423 100644 --- a/src/layer/Popup.js +++ b/src/layer/Popup.js @@ -44,6 +44,7 @@ L.Popup = L.Layer.extend({ L.DomUtil.setOpacity(this._container, 0); } + clearTimeout(this._removeTimeout); this.getPane().appendChild(this._container); this.update(); @@ -66,7 +67,7 @@ L.Popup = L.Layer.extend({ onRemove: function (map) { if (map._fadeAnimated) { L.DomUtil.setOpacity(this._container, 0); - setTimeout(L.bind(L.DomUtil.remove, L.DomUtil, this._container), 200); + this._removeTimeout = setTimeout(L.bind(L.DomUtil.remove, L.DomUtil, this._container), 200); } else { L.DomUtil.remove(this._container); }