Fixed chart labels not parsing HTML (fixes #1234)

This commit is contained in:
Djamil Legato
2017-09-30 16:16:47 -07:00
parent af6ca5a6fc
commit 4f3d9a02e9
3 changed files with 15 additions and 3 deletions

View File

@@ -3,6 +3,8 @@
1. [](#improved)
* Removed extraneous files in vendor folder
1. [](#bugfix)
* Fixed chart labels not parsing HTML [#1234](https://github.com/getgrav/grav-plugin-admin/issues/1234)
# v1.6.1
## 09/29/2017

View File

@@ -61,7 +61,17 @@ export default class Chart {
data
});
this.chart = chartist[this.type](this.element.find('.ct-chart').empty()[0], this.data, this.options);
this.chart.on('created', () => this.element.find('.hidden').removeClass('hidden'));
this.chart.on('created', () => {
this.element.find('.hidden').removeClass('hidden');
// FIX: workaround for chartist issue not allowing HTML in labels anymore
// https://github.com/gionkunz/chartist-js/issues/937
this.element.find('.ct-label').each((index, label) => {
label = $(label);
const text = label.html().replace('&lt;', '<').replace('&gt;', '>');
label.html(text);
});
});
}
updateData(data) {

File diff suppressed because one or more lines are too long