Skip to content

Commit d8671b1

Browse files
committed
Use Google Charts as like before
We don't have to do this upgrade right now.
1 parent a826dd4 commit d8671b1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/components/google-jsapi.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*global google*/
21
import Component from '@ember/component';
32

43
function createEvent(name) {
@@ -13,13 +12,15 @@ export default Component.extend({
1312
didInsertElement() {
1413
let script = document.createElement('script');
1514
script.onload = () => {
16-
google.charts.load('current', { packages: ['corechart'] });
17-
google.charts.setOnLoadCallback(() => {
18-
window.googleChartsLoaded = true;
19-
document.dispatchEvent(createEvent('googleChartsLoaded'));
15+
window.google.load('visualization', '1.0', {
16+
packages: ['corechart'],
17+
callback() {
18+
window.googleChartsLoaded = true;
19+
document.dispatchEvent(createEvent('googleChartsLoaded'));
20+
},
2021
});
2122
};
2223
document.body.appendChild(script);
23-
script.src = 'https://www.gstatic.com/charts/loader.js';
24+
script.src = 'https://www.google.com/jsapi';
2425
},
2526
});

0 commit comments

Comments
 (0)