Skip to content

Commit 4545bdc

Browse files
committed
DOMContentLoaded then run is called
1 parent 5aa5638 commit 4545bdc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/js/run.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ UI.init = function() {
66
UI.dnd.init();
77
};
88

9-
window.onresize = () => {
10-
UI.timeline.scale();
11-
UI.timeline.render();
12-
UI.series.render();
9+
UI.resize = () => {
10+
this.timeline.scale();
11+
this.timeline.render();
12+
this.series.render();
1313
return false;
1414
}
1515

1616
function run() {
17+
window.resize = UI.resize.bind( UI );
18+
1719
if ( STORE.has( "time" ) &&
1820
!TOOLS.pastDay( STORE.get( "time" ) ) &&
1921
STORE.has( "shows" ) ) {
@@ -23,4 +25,4 @@ function run() {
2325
}
2426
}
2527

26-
run();
28+
document.addEventListener( "DOMContentLoaded", run );

0 commit comments

Comments
 (0)