mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
removing filter buttons when closign account page
readding buttons when opening the account page back
This commit is contained in:
parent
f09d4bb50f
commit
809ef46e11
|
@ -664,34 +664,45 @@ $(".pageAccount .topFilters .button.toggleAdvancedFilters").on("click", () => {
|
|||
);
|
||||
});
|
||||
|
||||
Misc.getLanguageList().then((languages) => {
|
||||
languages.forEach((language) => {
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons"
|
||||
).append(
|
||||
`<div class="button" filter="${language}">${language.replace(
|
||||
"_",
|
||||
" "
|
||||
)}</div>`
|
||||
);
|
||||
export function appendButtons(): void {
|
||||
Misc.getLanguageList().then((languages) => {
|
||||
languages.forEach((language) => {
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons"
|
||||
).append(
|
||||
`<div class="button" filter="${language}">${language.replace(
|
||||
"_",
|
||||
" "
|
||||
)}</div>`
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
|
||||
).append(`<div class="button" filter="none">none</div>`);
|
||||
Misc.getFunboxList().then((funboxModes) => {
|
||||
funboxModes.forEach((funbox) => {
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
|
||||
).append(
|
||||
`<div class="button" filter="${funbox.name}">${funbox.name.replace(
|
||||
/_/g,
|
||||
" "
|
||||
)}</div>`
|
||||
);
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
|
||||
).append(`<div class="button" filter="none">none</div>`);
|
||||
Misc.getFunboxList().then((funboxModes) => {
|
||||
funboxModes.forEach((funbox) => {
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
|
||||
).append(
|
||||
`<div class="button" filter="${funbox.name}">${funbox.name.replace(
|
||||
/_/g,
|
||||
" "
|
||||
)}</div>`
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function removeButtons(): void {
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons"
|
||||
).empty();
|
||||
$(
|
||||
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
|
||||
).empty();
|
||||
}
|
||||
|
||||
$(".pageAccount .topFilters .button.createFilterPresetBtn").on("click", () => {
|
||||
startCreateFilterPreset();
|
||||
|
|
|
@ -1136,8 +1136,10 @@ export const page = new Page(
|
|||
},
|
||||
async () => {
|
||||
reset();
|
||||
ResultFilters.removeButtons();
|
||||
},
|
||||
async () => {
|
||||
ResultFilters.appendButtons();
|
||||
if (DB.getSnapshot().results == undefined) {
|
||||
$(".pageLoading .fill, .pageAccount .fill").css("width", "0%");
|
||||
$(".pageAccount .content").addClass("hidden");
|
||||
|
|
Loading…
Reference in a new issue