Commits

Anonymous committed 3547857

Make element IDs unique for the interactive charts scripts (so that multiple charts can be used on the same page).

Comments (0)

Files changed (4)

transifex/addons/charts/templates/project_chart.html

 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
-<script type="text/javascript" src="{{SITE_URL_PREFIX}}{% url chart_project_js project.slug %}"></script>
-<div id="transifex_chart">Loading chart...</div>
+<script type="text/javascript" src="{{ SITE_URL_PREFIX }}{% url chart_project_js project.slug %}"></script>
+<div id="txchart-{{ project.slug }}">Loading chart...</div>

transifex/addons/charts/templates/project_chart_js.html

     }
     var data = response.getDataTable();
 
-    container = document.getElementById('transifex_chart');
+    container = document.getElementById('txchart-{{ project.slug }}');
     container.style.textAlign = "center";
 
     chart_div = document.createElement('div');

transifex/addons/charts/templates/resource_chart.html

 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
 <script type="text/javascript" src="{{SITE_URL_PREFIX}}{% url chart_resource_js project.slug resource.slug %}"></script>
-<div id="transifex_chart">Loading chart...</div>
+<div id="txchart-{{ project.slug }}-{{ resource.slug }}">Loading chart...</div>

transifex/addons/charts/templates/resource_chart_js.html

     }
     var data = response.getDataTable();
 
-    container = document.getElementById('transifex_chart');
+    container = document.getElementById('txchart-{{ project.slug }}-{{ resource.slug }}');
     container.style.textAlign = "center";
 
     chart_div = document.createElement('div');