From: Alexander Ebert Date: Sun, 8 May 2022 11:42:21 +0000 (+0200) Subject: Merge pull request #4779 from WoltLab/search-result-pagination X-Git-Tag: 5.5.0_Beta_1~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff291de3634e291b16b74eab66a784ae78d8a4ed;p=GitHub%2FWoltLab%2FWCF.git Merge pull request #4779 from WoltLab/search-result-pagination Tracked the result page number in the url --- ff291de3634e291b16b74eab66a784ae78d8a4ed diff --cc ts/WoltLabSuite/Core/Ui/Search/Extended.ts index 6115fc36f4,0156b5c8bb..9f544e3ad8 --- a/ts/WoltLabSuite/Core/Ui/Search/Extended.ts +++ b/ts/WoltLabSuite/Core/Ui/Search/Extended.ts @@@ -75,28 -86,12 +86,28 @@@ export class UiSearchExtended } private changeType(): void { + let hasVisibleFilters = false; document.querySelectorAll(".objectTypeSearchFilters").forEach((filter: HTMLElement) => { - filter.hidden = filter.dataset.objectType !== this.typeInput.value; + if (filter.dataset.objectType === this.typeInput.value) { + hasVisibleFilters = true; + filter.hidden = false; + } else { + filter.hidden = true; + } }); + + const title = document.querySelector(".searchFiltersTitle") as HTMLElement; + if (hasVisibleFilters) { + const selectedOption = this.typeInput.selectedOptions.item(0)!; + title.textContent = selectedOption.textContent!.trim(); + + title.hidden = false; + } else { + title.hidden = true; + } } - private async search(): Promise { + private async search(searchAction: SearchAction): Promise { if (!this.queryInput.value.trim() && !this.usernameInput.value.trim()) { return; } diff --cc wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js index c9029526f8,76e9b8d7ec..95b89cc9d4 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js @@@ -51,27 -54,11 +54,27 @@@ define(["require", "exports", "tslib", }); } changeType() { + let hasVisibleFilters = false; document.querySelectorAll(".objectTypeSearchFilters").forEach((filter) => { - filter.hidden = filter.dataset.objectType !== this.typeInput.value; + if (filter.dataset.objectType === this.typeInput.value) { + hasVisibleFilters = true; + filter.hidden = false; + } + else { + filter.hidden = true; + } }); + const title = document.querySelector(".searchFiltersTitle"); + if (hasVisibleFilters) { + const selectedOption = this.typeInput.selectedOptions.item(0); + title.textContent = selectedOption.textContent.trim(); + title.hidden = false; + } + else { + title.hidden = true; + } } - async search() { + async search(searchAction) { var _a; if (!this.queryInput.value.trim() && !this.usernameInput.value.trim()) { return;