CityOfPhiladelphia / community-health-explorer

Host, edit and visualize CSV-based data using Jekyll, Leaflet & Chartist
http://healthexplorer.phila.gov
23 stars 8 forks source link

Liquid template format % doesn't persist district changes #1

Closed laurenancona closed 8 years ago

laurenancona commented 8 years ago

@timwis I think this is a scoping issue; since the % formatting is being done last via Liquid, it isn't triggered when Planning District is changed either by clicking map or the dropdown, since the page doesn't reload.

timwis commented 8 years ago

Right; it shouldn't have to. the updateIndicators function is what changes all the indicators. Can you point me to the line that isn't working?

laurenancona commented 8 years ago

This line begins the formatting template

timwis commented 8 years ago

oh, yeah. that's a tough one because the JS just replaces the contents of that DOM element entirely. Off the top of my head, we could have liquid add a data-type attribute to that <h1> tag, and have the JavaScript check if that attribute is set to Percentage, and then do the calculation before setting the contents of the dom element.