Skip to content

Commit

Permalink
Fixed #13110, chart.sonify no longer working.
Browse files Browse the repository at this point in the history
  • Loading branch information
oysteinmoseng committed Mar 18, 2020
1 parent d4352d3 commit 225d9cd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 3 additions & 2 deletions js/modules/accessibility/components/InfoRegionsComponent.js
Expand Up @@ -254,8 +254,9 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
* @return {string}
*/
defaultBeforeChartFormatter: function () {
var _a;
var chart = this.chart, format = chart.options.accessibility
.screenReaderSection.beforeChartFormat, axesDesc = this.getAxesDescription(), sonifyButtonId = 'highcharts-a11y-sonify-data-btn-' +
.screenReaderSection.beforeChartFormat, axesDesc = this.getAxesDescription(), shouldHaveSonifyBtn = chart.sonify && ((_a = chart.options.sonification) === null || _a === void 0 ? void 0 : _a.enabled), sonifyButtonId = 'highcharts-a11y-sonify-data-btn-' +
chart.index, dataTableButtonId = 'hc-linkto-highcharts-data-table-' +
chart.index, annotationsList = getAnnotationsInfoHTML(chart), annotationsTitleStr = chart.langFormat('accessibility.screenReaderSection.annotations.heading', { chart: chart }), context = {
chartTitle: getChartTitle(chart),
Expand All @@ -264,7 +265,7 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
chartLongdesc: this.getLongdescText(),
xAxisDescription: axesDesc.xAxis,
yAxisDescription: axesDesc.yAxis,
playAsSoundButton: chart.sonify ?
playAsSoundButton: shouldHaveSonifyBtn ?
this.getSonifyButtonText(sonifyButtonId) : '',
viewTableButton: chart.getCSV ?
this.getDataTableButtonText(dataTableButtonId) : '',
Expand Down
3 changes: 0 additions & 3 deletions js/modules/sonification/chartSonify.js
Expand Up @@ -735,9 +735,6 @@ function getChartSonifyOptions(chart, userOptions) {
*/
function chartSonify(options) {
var opts = getChartSonifyOptions(this, options);
if (opts.enabled === false) {
return;
}
// Only one timeline can play at a time.
if (this.sonification.timeline) {
this.sonification.timeline.pause();
Expand Down
3 changes: 2 additions & 1 deletion ts/modules/accessibility/components/InfoRegionsComponent.ts
Expand Up @@ -493,6 +493,7 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
format = chart.options.accessibility
.screenReaderSection.beforeChartFormat,
axesDesc = this.getAxesDescription(),
shouldHaveSonifyBtn = chart.sonify && chart.options.sonification?.enabled,
sonifyButtonId = 'highcharts-a11y-sonify-data-btn-' +
chart.index,
dataTableButtonId = 'hc-linkto-highcharts-data-table-' +
Expand All @@ -509,7 +510,7 @@ extend(InfoRegionsComponent.prototype, /** @lends Highcharts.InfoRegionsComponen
chartLongdesc: this.getLongdescText(),
xAxisDescription: axesDesc.xAxis,
yAxisDescription: axesDesc.yAxis,
playAsSoundButton: chart.sonify ?
playAsSoundButton: shouldHaveSonifyBtn ?
this.getSonifyButtonText(sonifyButtonId) : '',
viewTableButton: chart.getCSV ?
this.getDataTableButtonText(dataTableButtonId) : '',
Expand Down
4 changes: 0 additions & 4 deletions ts/modules/sonification/chartSonify.ts
Expand Up @@ -1106,10 +1106,6 @@ function chartSonify(
): void {
const opts = getChartSonifyOptions(this, options);

if (opts.enabled === false) {
return;
}

// Only one timeline can play at a time.
if (this.sonification.timeline) {
this.sonification.timeline.pause();
Expand Down

0 comments on commit 225d9cd

Please sign in to comment.