mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-09 15:15:58 +08:00
added escape handlers to popups
This commit is contained in:
parent
825a8e2732
commit
aab8792cee
6 changed files with 54 additions and 0 deletions
|
@ -556,3 +556,10 @@ $("#leaderboardsWrapper #leaderboards .rightTableJumpToMe").click(async (e) => {
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (event.key === "Escape" && !$("#leaderboardsWrapper").hasClass("hidden")) {
|
||||
hide();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -145,3 +145,13 @@ $(document).on("click", "#top .config .time .text-button", (e) => {
|
|||
show();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (
|
||||
event.key === "Escape" &&
|
||||
!$("#customTestDurationPopupWrapper").hasClass("hidden")
|
||||
) {
|
||||
hide();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -186,3 +186,13 @@ $("#customTextPopup .apply").click(() => {
|
|||
$("#customTextPopup .wordfilter").click(() => {
|
||||
WordFilterPopup.show();
|
||||
});
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (
|
||||
event.key === "Escape" &&
|
||||
!$("#customTextPopupWrapper").hasClass("hidden")
|
||||
) {
|
||||
hide();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -77,3 +77,13 @@ $(document).on("click", "#top .config .wordCount .text-button", (e) => {
|
|||
show();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (
|
||||
event.key === "Escape" &&
|
||||
!$("#customWordAmountPopupWrapper").hasClass("hidden")
|
||||
) {
|
||||
hide();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -725,3 +725,10 @@ $(document).on(
|
|||
list.applyCustomFont.show([]);
|
||||
}
|
||||
);
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (event.key === "Escape" && !$("#simplePopupWrapper").hasClass("hidden")) {
|
||||
hide();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -166,6 +166,16 @@ $("#practiseWordsPopup .button.both").on("focusout", (e) => {
|
|||
$("#practiseWordsPopup .missed").focus();
|
||||
});
|
||||
|
||||
$(document).keydown((event) => {
|
||||
if (
|
||||
event.key === "Escape" &&
|
||||
!$("#practiseWordsPopupWrapper").hasClass("hidden")
|
||||
) {
|
||||
hidePopup();
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
UpdateConfig.subscribeToEvent((eventKey) => {
|
||||
if (eventKey === "mode") resetBefore();
|
||||
|
|
Loading…
Add table
Reference in a new issue