Sync cursor highlight to hovered answer button on mouseover
This commit is contained in:
1 parent
1498bc261c
commit
b78557dbf2
1 file changed
+9
@@ -1147,10 +1147,19 @@ class Game {
|
|||||||
} else {
|
} else {
|
||||||
btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, q, container));
|
btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, q, container));
|
||||||
}
|
}
|
||||||
|
btn.addEventListener('mouseenter', () => {
|
||||||
|
this.state.cursor = slotIdx;
|
||||||
|
this._renderCursor();
|
||||||
|
});
|
||||||
container.appendChild(btn);
|
container.appendChild(btn);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isMulti) {
|
if (isMulti) {
|
||||||
|
confirmBtn.addEventListener('mouseenter', () => {
|
||||||
|
if (confirmBtn.classList.contains('confirm-inactive')) return;
|
||||||
|
this.state.cursor = 4;
|
||||||
|
this._renderCursor();
|
||||||
|
});
|
||||||
container.appendChild(confirmBtn);
|
container.appendChild(confirmBtn);
|
||||||
container._confirmBtn = confirmBtn;
|
container._confirmBtn = confirmBtn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user