Commit 81897ff
committed
fix: call functions inside setTimeout callbacks, not immediately
Fixed 3 occurrences where functions were being executed immediately
instead of being passed as callbacks to setTimeout.
1. js/widgets/rhythmruler.js:
- setTimeout(this._calculateZebraStripes(id), 1000)
+ setTimeout(() => this._calculateZebraStripes(id), 1000)
Impact: Prevents heavy DOM manipulation from blocking the UI thread
synchronously when pausing playback.
2. js/widgets/modewidget.js:
- setTimeout(this._resetNotes(), 500)
+ setTimeout(() => this._resetNotes(), 500)
Impact: Ensures note highlights persist for the intended duration
instead of disappearing instantly.
3. js/widgets/modewidget.js:
- setTimeout(this.widgetWindow.sendToCenter, 0)
+ setTimeout(() => this.widgetWindow.sendToCenter(), 0)
Impact: Preserves 'this' context for the sendToCenter method.1 parent da12f94 commit 81897ff
2 files changed
+43
-61
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 108 | + | |
| 109 | + | |
113 | 110 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 111 | + | |
| 112 | + | |
119 | 113 | | |
120 | 114 | | |
121 | 115 | | |
| |||
129 | 123 | | |
130 | 124 | | |
131 | 125 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 126 | + | |
| 127 | + | |
137 | 128 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 129 | + | |
| 130 | + | |
143 | 131 | | |
144 | 132 | | |
145 | 133 | | |
| |||
157 | 145 | | |
158 | 146 | | |
159 | 147 | | |
160 | | - | |
| 148 | + | |
161 | 149 | | |
162 | 150 | | |
163 | 151 | | |
| |||
689 | 677 | | |
690 | 678 | | |
691 | 679 | | |
692 | | - | |
| 680 | + | |
693 | 681 | | |
694 | 682 | | |
695 | 683 | | |
| |||
744 | 732 | | |
745 | 733 | | |
746 | 734 | | |
747 | | - | |
| 735 | + | |
748 | 736 | | |
749 | 737 | | |
750 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
497 | 494 | | |
498 | 495 | | |
499 | 496 | | |
500 | 497 | | |
501 | 498 | | |
502 | 499 | | |
503 | 500 | | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
517 | 511 | | |
518 | 512 | | |
519 | 513 | | |
| |||
639 | 633 | | |
640 | 634 | | |
641 | 635 | | |
642 | | - | |
| 636 | + | |
643 | 637 | | |
644 | 638 | | |
645 | 639 | | |
| |||
946 | 940 | | |
947 | 941 | | |
948 | 942 | | |
949 | | - | |
950 | | - | |
951 | | - | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
952 | 946 | | |
953 | 947 | | |
954 | 948 | | |
| |||
2224 | 2218 | | |
2225 | 2219 | | |
2226 | 2220 | | |
2227 | | - | |
2228 | | - | |
| 2221 | + | |
| 2222 | + | |
2229 | 2223 | | |
2230 | 2224 | | |
2231 | 2225 | | |
| |||
0 commit comments