Improve JavaScript code
authorMatthias Schmidt <gravatronics@live.com>
Fri, 3 Aug 2018 15:23:15 +0000 (17:23 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 3 Aug 2018 15:23:15 +0000 (17:23 +0200)
See #2509

wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Default.js
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/Tab.js
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Container/TabMenu.js
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js

index de048231965f0bc29aeda9f5664ab2f18a9a5f51..c2ca135b5c5e069b3a8586f114b39f640fdb6d90 100644 (file)
@@ -41,6 +41,7 @@ define(['./Abstract', 'Core', '../Manager'], function(Abstract, Core, Dependency
                        for (var i = start, length = children.length; i < length; i++) {
                                if (!elIsHidden(children.item(i))) {
                                        containerShouldBeVisible = true;
+                                       break;
                                }
                        }
                        
index d725eb4c3f3175bd15f0abac85cb1cac31253c21..d864e884151bc7f83589b6cdb094d7c5d5a97b72 100644 (file)
@@ -35,6 +35,7 @@ define(['./Abstract', 'Core', 'Dom/Util', '../Manager', 'Ui/TabMenu'], function(
                        for (var i = 0, length = children.length; i < length; i++) {
                                if (!elIsHidden(children.item(i))) {
                                        containerShouldBeVisible = true;
+                                       break;
                                }
                        }
                        
index 563468cb6a5034efadc3f8902ab956456c03d932..e8dedde8b66a351529d30cf52b26e9f7b8839d89 100644 (file)
@@ -35,6 +35,7 @@ define(['./Abstract', 'Core', 'Dom/Util', '../Manager', 'Ui/TabMenu'], function(
                        for (var i = 0, length = tabMenuListItems.length; i < length; i++) {
                                if (!elIsHidden(tabMenuListItems[i])) {
                                        containerShouldBeVisible = true;
+                                       break;
                                }
                        }
                        
index bdb92d1447e619db3f53684873be6bdddafc24c0..879940ce7bbd2964ae9ac318f5a7f417b7276d6f 100644 (file)
@@ -98,7 +98,7 @@ define(['Dictionary', 'Dom/ChangeListener', 'EventHandler', 'List', 'Dom/Travers
                                }
                                
                                _validatedFieldProperties.set(validatedField, properties);
-                       }.bind(this));
+                       });
                },
                
                /**
@@ -130,7 +130,7 @@ define(['Dictionary', 'Dom/ChangeListener', 'EventHandler', 'List', 'Dom/Travers
                                        
                                        _validatedFieldProperties.delete(validatedField);
                                }
-                       }.bind(this));
+                       });
                },
                
                /**
@@ -166,7 +166,7 @@ define(['Dictionary', 'Dom/ChangeListener', 'EventHandler', 'List', 'Dom/Travers
                },
                
                /**
-                * Check all dependencies if they are met.
+                * Checks if all dependencies are met.
                 */
                checkDependencies: function() {
                        var obsoleteNodes = [];
@@ -214,7 +214,7 @@ define(['Dictionary', 'Dom/ChangeListener', 'EventHandler', 'List', 'Dom/Travers
                },
                
                /**
-                * Checks the containers for their availablility.
+                * Checks the containers for their availability.
                 * 
                 * If this function is called while containers are currently checked, the containers
                 * will be checked after the current check has been finished completely.