From b1788574b26838f892af06ac67566ab6ed660315 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 21 Mar 2021 10:48:28 +0100 Subject: [PATCH] Replace use of `WCF.Action.SimpleProxy` with `Ui/Object/Action` --- ts/WoltLabSuite/Core/Ui/Object/Action.ts | 12 ++++++++---- .../install/files/acp/templates/languageList.tpl | 16 +--------------- .../js/WoltLabSuite/Core/Ui/Object/Action.js | 13 +++++++++---- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Object/Action.ts b/ts/WoltLabSuite/Core/Ui/Object/Action.ts index 6c1d35fc51..8ae30505fa 100644 --- a/ts/WoltLabSuite/Core/Ui/Object/Action.ts +++ b/ts/WoltLabSuite/Core/Ui/Object/Action.ts @@ -84,10 +84,14 @@ function executeAction(event: Event): void { } function processAction(actionElement: HTMLElement, data: ResponseData | DatabaseObjectActionResponse): void { - EventHandler.fire("WoltLabSuite/Core/Ui/Object/Action", actionElement.dataset.objectAction!, { - data, - objectElement: actionElement.closest(objectSelector), - } as ObjectActionData); + if (actionElement.dataset.objectActionSuccess === "reload") { + window.location.reload(); + } else { + EventHandler.fire("WoltLabSuite/Core/Ui/Object/Action", actionElement.dataset.objectAction!, { + data, + objectElement: actionElement.closest(objectSelector), + } as ObjectActionData); + } } const actions = new Set(); diff --git a/wcfsetup/install/files/acp/templates/languageList.tpl b/wcfsetup/install/files/acp/templates/languageList.tpl index 48319d69e2..ee51176b1f 100644 --- a/wcfsetup/install/files/acp/templates/languageList.tpl +++ b/wcfsetup/install/files/acp/templates/languageList.tpl @@ -1,19 +1,5 @@ {include file='header' pageTitle='wcf.acp.language.list'} - -

{lang}wcf.acp.language.list{/lang} {#$items}

@@ -58,7 +44,7 @@ {if !$language->isDefault} {objectAction action="toggle" isDisabled=$language->isDisabled} - + {else} diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Object/Action.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Object/Action.js index 45e4cef490..391c3a85df 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Object/Action.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Object/Action.js @@ -76,10 +76,15 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Event/Handler", "../ } } function processAction(actionElement, data) { - EventHandler.fire("WoltLabSuite/Core/Ui/Object/Action", actionElement.dataset.objectAction, { - data, - objectElement: actionElement.closest(objectSelector), - }); + if (actionElement.dataset.objectActionSuccess === "reload") { + window.location.reload(); + } + else { + EventHandler.fire("WoltLabSuite/Core/Ui/Object/Action", actionElement.dataset.objectAction, { + data, + objectElement: actionElement.closest(objectSelector), + }); + } } const actions = new Set(); function registerElements() { -- 2.20.1