diff --git a/leaflet-popup.html b/leaflet-popup.html index 874cf64..074d145 100644 --- a/leaflet-popup.html +++ b/leaflet-popup.html @@ -16,16 +16,19 @@ } this.feature.unbindPopup(); // TODO: Hack, ignore -tag - var content = Polymer.dom(this).innerHTML.replace(/<\/?leaflet-point[^>]*>/g, "").trim(); + var content = this.innerHTML.replace(/<\/?leaflet-point[^>]*>/g, "").trim(); + if(!content) { // above code does not work with static content, below not with dynamic content -.- + content = Polymer.dom(this).innerHTML.replace(/<\/?leaflet-point[^>]*>/g, "").trim(); + } if (content) { this.feature.bindPopup(content); } }, - + detached: function() { if (this.observer_) { this.observer_.disconnect(); } } } - \ No newline at end of file +