From 0091d87dc977aee3678ae5d098f18cb99a948173 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 22 Dec 2017 13:27:44 +0530 Subject: [PATCH] Fixed growing of doughnut charts on scrolling. Charts were growing on many pages due to spaces in id. Fixes #1903 --- app/views/admin/conferences/_doughnut_chart.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/conferences/_doughnut_chart.html.haml b/app/views/admin/conferences/_doughnut_chart.html.haml index f4a8f0ba..6ad75cef 100644 --- a/app/views/admin/conferences/_doughnut_chart.html.haml +++ b/app/views/admin/conferences/_doughnut_chart.html.haml @@ -1,6 +1,6 @@ .text-center %h4 #{title} - %canvas.doughnut_chart{ id: "dough_#{title}", 'data-chart' => data.to_json } + %canvas.doughnut_chart{ id: "dough_#{title.parameterize.underscore}", 'data-chart' => data.to_json } - if data - data.each do |key, value| %span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']} @@ -8,7 +8,7 @@ :javascript $(document).ready( function(){ - var d = $("#dough_#{title}"); + var d = $("#dough_#{title.parameterize.underscore}"); var dt = d.get(0).getContext('2d'); $(window).resize( respondCanvas );