Uninitialized variable and comma expression
authorAlexander Ebert <ebert@woltlab.com>
Thu, 14 Nov 2019 13:38:18 +0000 (14:38 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 14 Nov 2019 13:38:18 +0000 (14:38 +0100)
Fixes #3102

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dropdown/Simple.js

index 27ba02821dc7f0e11f12bf498ee45fb787a304fc..660cb68db000388e2c015499b231422fd5180ab9 100644 (file)
@@ -413,12 +413,13 @@ define(
                        
                        var dropdown = _dropdowns.get(targetId), preventToggle = false;
                        if (dropdown !== undefined) {
-                               var button;
+                               var button, parent;
                                
                                // check if the dropdown is still the same, as some components (e.g. page actions)
                                // re-create the parent of a button
                                if (event) {
-                                       button = event.currentTarget, parent = button.parentNode;
+                                       button = event.currentTarget;
+                                       parent = button.parentNode;
                                        if (parent !== dropdown) {
                                                parent.classList.add('dropdown');
                                                parent.id = dropdown.id;