From: Alexander Ebert Date: Fri, 17 Jul 2020 12:24:15 +0000 (+0200) Subject: Prevent gaps in the page action buttons X-Git-Tag: 5.3.0_Alpha_1~133 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e343c91c056f1d228e248faf2ce8737c861534cb;p=GitHub%2FWoltLab%2FWCF.git Prevent gaps in the page action buttons Fixes #3402 --- diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index b7d91db394..a8c625d199 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1840,7 +1840,7 @@ if (COMPILER_TARGET_DEFAULT) { UiPageAction.show(buttonName); } else { - UiPageAction.hide(buttonName); + UiPageAction.remove(buttonName); } this._hasTemplate = false; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Action.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Action.js index e9ffa17c24..5467ca3c46 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Action.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Action.js @@ -106,15 +106,21 @@ define(['Dictionary', 'Dom/Util'], function(Dictionary, DomUtil) { var button = _buttons.get(buttonName); if (button !== undefined) { var listItem = button.parentNode; - listItem.addEventListener('animationend', function () { + var callback = function () { try { - _container.removeChild(listItem); - _buttons.delete(buttonName); + if (elAttrBool(listItem, 'aria-hidden')) { + _container.removeChild(listItem); + _buttons.delete(buttonName); + } + + listItem.removeEventListener('animationend', callback); } catch (e) { // ignore errors if the element has already been removed } - }); + }; + + listItem.addEventListener('animationend', callback); this.hide(buttonName); }