From: Tim Düsterhus Date: Tue, 16 Feb 2021 15:26:35 +0000 (+0100) Subject: Fix the visual marking of the markAll checkbox for Controller/Clipboard.ts X-Git-Tag: 5.4.0_Alpha_1~262 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=396f86c135af33173ff824a25bf534c8099d9f1a;p=GitHub%2FWoltLab%2FWCF.git Fix the visual marking of the markAll checkbox for Controller/Clipboard.ts During the refactoring to TypeScript it was missed that after matching the `.columnMark` class another access to `.parentNode` happens: https://github.com/WoltLab/WCF/blob/6a623551e6d7a08ffdf7a623aa174e644af7a0d5/wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js#L691 Fixes #3999 --- diff --git a/ts/WoltLabSuite/Core/Controller/Clipboard.ts b/ts/WoltLabSuite/Core/Controller/Clipboard.ts index 7d09992357..6df0aeeb37 100644 --- a/ts/WoltLabSuite/Core/Controller/Clipboard.ts +++ b/ts/WoltLabSuite/Core/Controller/Clipboard.ts @@ -616,7 +616,7 @@ class ControllerClipboard { this.setParentAsMarked(data.markAll, markAll); - const parent = data.markAll.closest(".columnMark"); + const parent = data.markAll.closest(".columnMark")?.parentNode as HTMLElement | null; if (parent) { if (markAll) { parent.classList.add("jsMarked"); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js index e2544126b8..b78b952464 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Controller/Clipboard.js @@ -452,6 +452,7 @@ define(["require", "exports", "tslib", "../Ajax", "../Core", "../Dom/Change/List * Rebuilds the mark state for each item. */ rebuildMarkings(data, objectIds) { + var _a; let markAll = true; Array.from(data.checkboxes).forEach((checkbox) => { const clipboardObject = checkbox.closest(".jsClipboardObject"); @@ -471,7 +472,7 @@ define(["require", "exports", "tslib", "../Ajax", "../Core", "../Dom/Change/List if (data.markAll !== null) { data.markAll.checked = markAll; this.setParentAsMarked(data.markAll, markAll); - const parent = data.markAll.closest(".columnMark"); + const parent = (_a = data.markAll.closest(".columnMark")) === null || _a === void 0 ? void 0 : _a.parentNode; if (parent) { if (markAll) { parent.classList.add("jsMarked");