olwidget icon indicating copy to clipboard operation
olwidget copied to clipboard

Feature Request: set class (other attributes?) of map div

Open spacedman opened this issue 15 years ago • 2 comments

Could it be possible to set the class of the DIV created by InfoMap instances (and possibly the others). At the moment the template creates it with only an id attribute, but it would be useful for the rendering template to set the class. This could also extend to other attributes of the DIV, but of course all your styling should be done by class/id anyway.

spacedman avatar Dec 31 '10 15:12 spacedman

Looking at the code, this seems to be because there's no attrs parameter passed to the Map constructor. This seems to be the standard way to pass attributes to widget HTML (from my inspection of the Django widget codes).

spacedman avatar Dec 31 '10 15:12 spacedman

I just implemented a small tweak to make this possible. Simply change the constructor of "Map" to add "attrs=None" at the end, and then pass attrs to the super constructor.

I can write this into a patch - should I pull and request a commit? Is this a bug or a decision?

cazgp avatar Jul 24 '12 19:07 cazgp