Prevent gaps in the page action buttons
authorAlexander Ebert <ebert@woltlab.com>
Fri, 17 Jul 2020 12:24:15 +0000 (14:24 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 17 Jul 2020 12:24:15 +0000 (14:24 +0200)
Fixes #3402

wcfsetup/install/files/js/WCF.Message.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Action.js

index b7d91db394b2fe3b07373bd119dd58ffe4b558f0..a8c625d1998cf6dc0df54e4bffd434dc78a83b95 100644 (file)
@@ -1840,7 +1840,7 @@ if (COMPILER_TARGET_DEFAULT) {
                                        UiPageAction.show(buttonName);
                                }
                                else {
-                                       UiPageAction.hide(buttonName);
+                                       UiPageAction.remove(buttonName);
                                }
                                
                                this._hasTemplate = false;
index e9ffa17c2435adeb9d601b54130092d3197fd991..5467ca3c467fb5d1ac09058f768ffe2579f949d1 100644 (file)
@@ -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);
                        }