removing filter buttons when closign account page

readding buttons when opening the account page back
This commit is contained in:
Miodec 2022-10-09 01:30:27 +02:00
parent f09d4bb50f
commit 809ef46e11
2 changed files with 38 additions and 25 deletions

View file

@ -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();

View file

@ -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");