From: Alexander Ebert Date: Thu, 30 Jan 2020 13:30:13 +0000 (+0100) Subject: Disable the user edit button if there are no accessible actions X-Git-Tag: 5.2.2~21^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d3d85623a6d63780ef3f81d1b677ed0949c218b8;p=GitHub%2FWoltLab%2FWCF.git Disable the user edit button if there are no accessible actions --- 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);