mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
correct it so we always load Chart just before creating it
This commit is contained in:
parent
565fa1f60e
commit
f9d2c69bbe
@ -2,6 +2,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||
import AsyncReport from "admin/mixins/async-report";
|
||||
import Report from "admin/models/report";
|
||||
import { number } from 'discourse/lib/formatter';
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
|
||||
function collapseWeekly(data, average) {
|
||||
let aggregate = [];
|
||||
@ -110,7 +111,10 @@ export default Ember.Component.extend(AsyncReport, {
|
||||
if (this._chart) {
|
||||
this._chart.destroy();
|
||||
}
|
||||
this._chart = new window.Chart(context, this._buildChartConfig(data));
|
||||
|
||||
loadScript("/javascripts/Chart.min.js").then(() => {
|
||||
this._chart = new window.Chart(context, this._buildChartConfig(data));
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -1,9 +1,5 @@
|
||||
import loadScript from "discourse/lib/load-script";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
activate() {
|
||||
loadScript("/javascripts/Chart.min.js").then(() => {
|
||||
this.controllerFor('admin-dashboard-next').fetchDashboard();
|
||||
});
|
||||
this.controllerFor('admin-dashboard-next').fetchDashboard();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user