From: Alexander Ebert Date: Sun, 14 May 2023 16:47:58 +0000 (+0200) Subject: Fix the replacement of the pagination in the media manager X-Git-Tag: 6.0.0_Alpha_1~103 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e37e9c4cee748c065cbf5b8ebcc8710bd6670a14;p=GitHub%2FWoltLab%2FWCF.git Fix the replacement of the pagination in the media manager Fixes #5503 --- diff --git a/ts/WoltLabSuite/Core/Media/Manager/Base.ts b/ts/WoltLabSuite/Core/Media/Manager/Base.ts index 69d4272fa4..8b6989d588 100644 --- a/ts/WoltLabSuite/Core/Media/Manager/Base.ts +++ b/ts/WoltLabSuite/Core/Media/Manager/Base.ts @@ -296,10 +296,10 @@ abstract class MediaManager 1) { const newPagination = document.createElement("div"); newPagination.className = "paginationBottom jsPagination"; - DomUtil.replaceElement( - UiDialog.getDialog(this)!.content.querySelector(".jsPagination") as HTMLElement, - newPagination, - ); + + const oldPagination = UiDialog.getDialog(this)!.content.querySelector(".jsPagination") as HTMLElement; + oldPagination.insertAdjacentElement("beforebegin", newPagination); + oldPagination.remove(); this._pagination = new UiPagination(newPagination, { activePage: pageNo, diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Base.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Base.js index 4d0eeeb19c..3649ebef33 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Base.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Base.js @@ -236,7 +236,9 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../../Pe if (pageCount > 1) { const newPagination = document.createElement("div"); newPagination.className = "paginationBottom jsPagination"; - DomUtil.replaceElement(UiDialog.getDialog(this).content.querySelector(".jsPagination"), newPagination); + const oldPagination = UiDialog.getDialog(this).content.querySelector(".jsPagination"); + oldPagination.insertAdjacentElement("beforebegin", newPagination); + oldPagination.remove(); this._pagination = new Pagination_1.default(newPagination, { activePage: pageNo, callbackSwitch: (pageNo) => this._search.search(pageNo),