Destroy charts before the layout removes them from the DOM (#9795)

Backports PR #9728

**Commit 1:**
Destroy charts before the layout removes them from the DOM

* Original sha: e4e773c10c
* Authored by Jacob Brandt <jbrandt@dcsdk12.org> on 2017-01-04T20:55:22Z
This commit is contained in:
jasper 2017-01-09 13:59:25 -05:00 committed by Thomas Neirynck
parent 2636d25179
commit 76c0dc891d

View file

@ -84,6 +84,12 @@ export default function MapsFactory(Private) {
}
draw() {
// Destroy the charts before they get removed from the DOM on the new
// layout render.
if(this.charts !== undefined) {
this.charts.forEach(chart => chart.destroy());
}
this.layout.render();
// todo: title
const self = this;