Permalink
Browse files

MDL-57338 chart: add example context

And fix aria roles
  • Loading branch information...
danpoltawski committed Dec 9, 2016
1 parent 2f74b07 commit b4a65796cf03acb0d8c878596b04679586c320fd
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/templates/chart.mustache
@@ -15,17 +15,25 @@
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template core/chart
Chart rendering.
Example context (json):
{
"withtable": true,
"chartdata": "null"
}
}}
<div class="chart-area" id="chart-area-{{uniqid}}">
<div class="chart-image" role="decoration" aria-describedby="chart-table-data-{{uniqid}}"></div>
<div class="chart-image" role="presentation" aria-describedby="chart-table-data-{{uniqid}}"></div>
<div class="chart-table {{^withtable}}accesshide{{/withtable}}">
<p class="chart-table-expand">
<a href="#" aria-controls="chart-table-data-{{uniqid}}" role="button">
{{#str}}showchartdata, moodle{{/str}}
</a>
</p>
<div class="chart-table-data" id="chart-table-data-{{uniqid}}" {{#withtable}}aria-expanded="false"{{/withtable}}></div>
<div class="chart-table-data" id="chart-table-data-{{uniqid}}" {{#withtable}}role="complementary" aria-expanded="false"{{/withtable}}></div>
</div>
</div>

0 comments on commit b4a6579

Please sign in to comment.