ugh?
This commit is contained in:
parent
c6c659535e
commit
be327165b8
|
|
@ -8,13 +8,13 @@ export class Renderer {
|
|||
|
||||
constructor() {
|
||||
this.numStaves = 6;
|
||||
this.currStaveNumber = 1; // ✅ Initialize current stave number
|
||||
this.currStaveNumber = 1;
|
||||
this.timeIndicator = document.querySelector("#time-indicator");
|
||||
|
||||
this.timeIndicator.addEventListener("animationiteration", () => {
|
||||
this.currStaveNumber++;
|
||||
if (this.currStaveNumber > this.numStaves) {
|
||||
this.cleanUpAndRestart(); // ✅ Use this.method
|
||||
this.cleanUpAndRestart();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -39,7 +39,6 @@ export class Renderer {
|
|||
placeIcon = (instrument) => {
|
||||
if (this.currStaveNumber > this.numStaves) this.currStaveNumber = 1;
|
||||
|
||||
// ✅ Use a local variable instead of overwriting this.staveWrapper
|
||||
const targetWrapper = document.getElementById(
|
||||
`stave-wrapper-${this.currStaveNumber}`
|
||||
);
|
||||
|
|
@ -61,7 +60,7 @@ export class Renderer {
|
|||
eventIcon.data = instrument.image;
|
||||
|
||||
newObject.appendChild(eventIcon);
|
||||
targetWrapper.appendChild(newObject); // ✅ Append to local reference
|
||||
targetWrapper.appendChild(newObject);
|
||||
};
|
||||
|
||||
cleanUpAndRestart(reload = false) {
|
||||
|
|
@ -77,7 +76,6 @@ export class Renderer {
|
|||
|
||||
this.currStaveNumber = 1;
|
||||
|
||||
// Assuming setTitle() exists globally or is handled elsewhere
|
||||
Conductor.setTitle();
|
||||
|
||||
if (reload) location.reload();
|
||||
|
|
|
|||
Loading…
Reference in New Issue