mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 01:44:50 +08:00
brought back search, added a search placeholder
This commit is contained in:
parent
21e8cf8299
commit
ab1588fd2f
2 changed files with 13 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ import * as Misc from "./misc";
|
|||
export async function showWordFilterPopup() {
|
||||
$("#wordFilterPopupWrapper").removeClass("hidden");
|
||||
$("#customTextPopupWrapper").addClass("hidden");
|
||||
$("#languageList").empty();
|
||||
let LanguageList = await Misc.getLanguageList();
|
||||
LanguageList.forEach((language) => {
|
||||
let prettyLang = language;
|
||||
|
|
@ -11,9 +12,7 @@ export async function showWordFilterPopup() {
|
|||
<option value=${language}>${prettyLang}</option>
|
||||
`);
|
||||
});
|
||||
$("#languageList").select2({
|
||||
minimumResultsForSearch: -1,
|
||||
});
|
||||
$("#languageList").select2();
|
||||
}
|
||||
|
||||
function hideWordFilterPopup() {
|
||||
|
|
@ -81,3 +80,7 @@ async function filter(language) {
|
|||
}
|
||||
return filteredWords;
|
||||
}
|
||||
|
||||
$("#languageList").one("select2:open", function (e) {
|
||||
$("input.select2-search__field").prop("placeholder", "search");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -206,6 +206,13 @@ html {
|
|||
border-color: var(--main-color) transparent;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-search--dropdown .select2-search__field {
|
||||
border-color: rgba(0, 0, 0, 0.1);
|
||||
background: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
border-radius: var(--roundness);
|
||||
}
|
||||
|
||||
/* width */
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue