Fix popup not filled with dynamic content #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure why Polymer.dom(this).innerHTML is empty while this.innerHTML is not - maybe this is a polymer issue, maybe I am doing something wrong setting the innerHTML. This (popup content not updating) happened when I did something like this :
It was fixed by using this.innerHTML instead of Polymer.dom(this).innerHTML in leaflet-popup.html . Not sure if this is the best solution, but I don't see it violating polymer guidelines, they only say we have to use Polymer.dom for manipulations (https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#dom-api) - this is no manipulation.
If anyone knows of a better solution that would be awesome, as this workaround is kind of awkward.
/edit : Using Polymer.dom(that.$$('leaflet-marker')) instead of that.$$('leaflet-marker') worked even less reliable (even when using Polymer.dom.flush()), maybe this and that.$$ are already Polymer.dom-objects and that's why it does not work?