Commit | Line | Data |
---|---|---|
8aecc0ed MS |
1 | /** |
2 | * Reacts to participants being removed from a conversation. | |
3 | * | |
4 | * @author Matthias Schmidt | |
5 | * @copyright 2001-2021 WoltLab GmbH | |
6 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> | |
7 | * @module WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant | |
8 | */ | |
9 | ||
10 | import UiObjectActionHandler from "WoltLabSuite/Core/Ui/Object/Action/Handler"; | |
18a17ac7 | 11 | import { ObjectActionData } from "WoltLabSuite/Core/Ui/Object/Data"; |
8aecc0ed | 12 | |
18a17ac7 MS |
13 | function removeParticipant(data: ObjectActionData): void { |
14 | data.objectElement.querySelector(".userLink")!.classList.add("conversationLeft"); | |
15 | data.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']")!.remove(); | |
8aecc0ed MS |
16 | } |
17 | ||
18 | export function setup(): void { | |
19 | new UiObjectActionHandler("removeParticipant", [], removeParticipant); | |
20 | } |