From d3d85623a6d63780ef3f81d1b677ed0949c218b8 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 30 Jan 2020 14:30:13 +0100 Subject: [PATCH] Disable the user edit button if there are no accessible actions --- .../install/files/js/WoltLabSuite/Core/Acp/Ui/User/Editor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Editor.js index 1fc9cf08ad..8322fd6507 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/User/Editor.js @@ -34,6 +34,11 @@ define(['Ajax', 'Core', 'EventHandler', 'Language', 'Ui/SimpleDropdown', 'WoltLa var dropdownMenu = UiSimpleDropdown.getDropdownMenu('userListDropdown' + userId); var legacyButtonContainer = elBySel('.jsLegacyButtons', userRow); + if (dropdownMenu.childElementCount === 0 && legacyButtonContainer.childElementCount === 0) { + elBySel('.dropdownToggle', userRow).classList.add('disabled'); + return; + } + UiSimpleDropdown.registerCallback('userListDropdown' + userId, (function (identifier, action) { if (action === 'open') { this._rebuild(userId, dropdownMenu, legacyButtonContainer); -- 2.20.1