From: Marcel Werk Date: Sat, 7 May 2022 17:11:55 +0000 (+0200) Subject: Proper prototype creation X-Git-Tag: 5.5.0_Beta_1~10^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6ec1c039abc11ab8a5c166aa1bf663076a8342b3;p=GitHub%2FWoltLab%2FWCF.git Proper prototype creation --- diff --git a/ts/WoltLabSuite/Core/Ui/Search/Extended.ts b/ts/WoltLabSuite/Core/Ui/Search/Extended.ts index 1494a01a88..0156b5c8bb 100644 --- a/ts/WoltLabSuite/Core/Ui/Search/Extended.ts +++ b/ts/WoltLabSuite/Core/Ui/Search/Extended.ts @@ -42,12 +42,12 @@ export class UiSearchExtended { private readonly queryInput: HTMLInputElement; private readonly typeInput: HTMLSelectElement; private readonly usernameInput: HTMLInputElement; - private searchID: number | undefined; + private readonly delimiter: HTMLDivElement; + private searchID: number | undefined = undefined; private pages = 0; private activePage = 1; private lastSearchRequest: AbortController | undefined = undefined; private lastSearchResultRequest: AbortController | undefined = undefined; - private delimiter: HTMLDivElement; private searchParameters: SearchParameters = []; constructor() { @@ -55,18 +55,14 @@ export class UiSearchExtended { this.queryInput = document.getElementById("searchQuery") as HTMLInputElement; this.typeInput = document.getElementById("searchType") as HTMLSelectElement; this.usernameInput = document.getElementById("searchAuthor") as HTMLInputElement; + this.delimiter = document.createElement("div"); - this.initDelimiter(); + this.form.insertAdjacentElement("afterend", this.delimiter); this.initEventListener(); this.initKeywordSuggestions(); this.initQueryString(); } - private initDelimiter(): void { - this.delimiter = document.createElement("div"); - this.form.insertAdjacentElement("afterend", this.delimiter); - } - private initEventListener(): void { this.form.addEventListener("submit", (event) => { event.preventDefault(); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js index 03528c0891..76e9b8d7ec 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Extended.js @@ -18,6 +18,7 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Date/Picker", "../.. UiScroll = tslib_1.__importStar(UiScroll); class UiSearchExtended { constructor() { + this.searchID = undefined; this.pages = 0; this.activePage = 1; this.lastSearchRequest = undefined; @@ -27,15 +28,12 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Date/Picker", "../.. this.queryInput = document.getElementById("searchQuery"); this.typeInput = document.getElementById("searchType"); this.usernameInput = document.getElementById("searchAuthor"); - this.initDelimiter(); + this.delimiter = document.createElement("div"); + this.form.insertAdjacentElement("afterend", this.delimiter); this.initEventListener(); this.initKeywordSuggestions(); this.initQueryString(); } - initDelimiter() { - this.delimiter = document.createElement("div"); - this.form.insertAdjacentElement("afterend", this.delimiter); - } initEventListener() { this.form.addEventListener("submit", (event) => { event.preventDefault();