Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix popup not filled with dynamic content #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Compufreak345
Copy link
Contributor

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 :

ready : function() {
   var that = this;
   window.setTimeout(function(){that.injectMarkerTitle(that)},300);
},
injectMarkerTitle : function(that) {
   that.$$('leaflet-marker').innerHTML = "<b>TEST!</b>";
}

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?

Not sure why Polymer.dom(this).innerHTML is empty while this.innerHTML is not.
this.innerHTML does not contain calculated stuff like <content
style=„…“></content>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant