mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-11 01:15:49 +08:00
focusing practise popup. closes #1663
This commit is contained in:
parent
ba7e5c9460
commit
2b50edc9cb
4 changed files with 15 additions and 11 deletions
|
@ -90,13 +90,18 @@ export function resetBefore() {
|
|||
before.numbers = null;
|
||||
}
|
||||
|
||||
export function showPopup() {
|
||||
export function showPopup(focus = false) {
|
||||
if ($("#practiseWordsPopupWrapper").hasClass("hidden")) {
|
||||
$("#practiseWordsPopupWrapper")
|
||||
.stop(true, true)
|
||||
.css("opacity", 0)
|
||||
.removeClass("hidden")
|
||||
.animate({ opacity: 1 }, 100);
|
||||
.animate({ opacity: 1 }, 100, () => {
|
||||
if (focus) {
|
||||
console.log("focusing");
|
||||
$("#practiseWordsPopup .missed").focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1005,10 +1005,9 @@ $(document.body).on("click", "#restartTestButton", () => {
|
|||
});
|
||||
|
||||
$(document).on("keypress", "#practiseWordsButton", (event) => {
|
||||
// if (event.keyCode == 13) {
|
||||
// PractiseWords.init();
|
||||
// }
|
||||
PractiseWords.showPopup();
|
||||
if (event.keyCode == 13) {
|
||||
PractiseWords.showPopup(true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document.body).on("click", "#practiseWordsButton", () => {
|
||||
|
|
|
@ -3585,8 +3585,8 @@ key {
|
|||
outline: none;
|
||||
}
|
||||
&:focus {
|
||||
color: var(--text-color);
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
color: var(--main-color);
|
||||
background: var(--sub-color);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,9 +126,9 @@
|
|||
more often or words that you typed much slower will be weighted higher
|
||||
and appear more often.
|
||||
</div>
|
||||
<div class="button missed">Practice missed</div>
|
||||
<div class="button slow">Practice slow</div>
|
||||
<div class="button both">Practice both</div>
|
||||
<div class="button missed" tabindex="1">Practice missed</div>
|
||||
<div class="button slow" tabindex="1">Practice slow</div>
|
||||
<div class="button both" tabindex="1">Practice both</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue