MDL-55355 core: Fix incorrect chart link selector
authorSimey Lameze <simey@moodle.com>
Wed, 3 Aug 2016 01:42:27 +0000 (09:42 +0800)
committerSimey Lameze <simey@moodle.com>
Wed, 3 Aug 2016 02:21:48 +0000 (10:21 +0800)
lib/templates/chart.mustache

index 40736dd..3486735 100644 (file)
@@ -40,14 +40,14 @@ require([
         uniqid = "{{uniqid}}",
         chartArea = $('#chart-area-' + uniqid),
         chartImage = chartArea.find('.chart-image'),
-        chartTable = chartArea.find('.chart-table-data');
+        chartTable = chartArea.find('.chart-table-data'),
         chartLink = chartArea.find('.chart-table-expand a');
     Builder.make(data).then(function(ChartInst) {
         new Output(chartImage, ChartInst);
         new OutputTable(chartTable, ChartInst);
     });
 
-    chartArea.find('.chart-table-expand a').first().click(function(e) {
+    chartLink.on('click', function(e) {
         e.preventDefault();
         if (chartTable.is(':visible')) {
             chartTable.hide();