* Fix JS lint issues * Do not rely on globals * Use InstantClick to make transitions work in the pro dashboard * Fix eager loadings and remove unused queries * Refactor drawChart * More consistency in naming * Display correct analytics for organization
16 lines
376 B
JavaScript
16 lines
376 B
JavaScript
import initCharts from '../analytics/dashboard';
|
|
|
|
function initDashboard() {
|
|
const activeOrg = document.querySelector('.organization.active');
|
|
if (activeOrg) {
|
|
initCharts({ organizationId: activeOrg.dataset.organizationId });
|
|
} else {
|
|
initCharts({ organizationId: null });
|
|
}
|
|
}
|
|
|
|
window.InstantClick.on('change', () => {
|
|
initDashboard();
|
|
});
|
|
|
|
initDashboard();
|