MDL-55355 core: Change chart link text when status change
authorSimey Lameze <simey@moodle.com>
Fri, 29 Jul 2016 02:13:37 +0000 (10:13 +0800)
committerSimey Lameze <simey@moodle.com>
Mon, 1 Aug 2016 01:13:59 +0000 (09:13 +0800)
lang/en/moodle.php
lib/templates/chart.mustache

index 9e1ee63..b6e7255 100644 (file)
@@ -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';
index b04977c..40736dd 100644 (file)
@@ -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);
         }
     });