diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 9e1ee63acb8..b6e72550875 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -923,6 +923,7 @@ $string['hiddensectionscollapsed'] = 'Hidden sections are shown in collapsed for $string['hiddensectionsinvisible'] = 'Hidden sections are completely invisible'; $string['hide'] = 'Hide'; $string['hideadvancedsettings'] = 'Hide advanced settings'; +$string['hidechartdata'] = 'Hide chart data'; $string['hidepicture'] = 'Hide picture'; $string['hidesection'] = 'Hide section {$a}'; $string['hidesettings'] = 'Hide settings'; diff --git a/lib/templates/chart.mustache b/lib/templates/chart.mustache index b04977ccb9d..40736dde947 100644 --- a/lib/templates/chart.mustache +++ b/lib/templates/chart.mustache @@ -41,7 +41,7 @@ require([ chartArea = $('#chart-area-' + uniqid), chartImage = chartArea.find('.chart-image'), 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); @@ -51,9 +51,11 @@ require([ e.preventDefault(); if (chartTable.is(':visible')) { chartTable.hide(); + chartLink.text({{#quote}}{{#str}}showchartdata, moodle{{/str}}{{/quote}}); chartTable.attr('aria-expanded', false); } else { chartTable.show(); + chartLink.text({{#quote}}{{#str}}hidechartdata, moodle{{/str}}{{/quote}}); chartTable.attr('aria-expanded', true); } });