fix(canvas): auto-initialize courier network canvas on DOM load
CI / Build & Quality Check (push) Waiting to run
CI / Build & Quality Check (push) Waiting to run
This commit is contained in:
@@ -246,3 +246,14 @@ function initCourierCanvas(canvasId = 'hubmap') {
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-initialize canvas on page load
|
||||
if (typeof window !== 'undefined') {
|
||||
window.initCourierCanvas = initCourierCanvas;
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', () => initCourierCanvas('hubmap'));
|
||||
} else {
|
||||
initCourierCanvas('hubmap');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user