From e343c91c056f1d228e248faf2ce8737c861534cb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 17 Jul 2020 14:24:15 +0200 Subject: [PATCH] Prevent gaps in the page action buttons Fixes #3402 --- wcfsetup/install/files/js/WCF.Message.js | 2 +- .../files/js/WoltLabSuite/Core/Ui/Page/Action.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) 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); } -- 2.20.1