Fix form field dependencies on language form fields
authorMatthias Schmidt <gravatronics@live.com>
Sun, 29 Sep 2019 16:26:19 +0000 (18:26 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 29 Sep 2019 16:26:19 +0000 (18:26 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js
wcfsetup/install/files/js/WoltLabSuite/Core/Language/Chooser.js

index ffcb47be97389d4e73cdeb61a59e7edfb26b19ff..c0daf156a31d4aa58a7567c9682d455de30c7876 100644 (file)
@@ -180,7 +180,7 @@ define(['Dictionary', 'Dom/ChangeListener', 'EventHandler', 'List', 'Dom/Travers
                                if (!_fields.has(id)) {
                                        _fields.set(id, field);
                                        
-                                       if (field.tagName === 'INPUT' && (field.type === 'checkbox' || field.type === 'radio')) {
+                                       if (field.tagName === 'INPUT' && (field.type === 'checkbox' || field.type === 'radio' || field.type === 'hidden')) {
                                                field.addEventListener('change', this.checkDependencies.bind(this));
                                        }
                                        else {
index 05fb6933f658bfd3f4ccd2da1909cfe80cc266a1..20f5fc81d568905831ba7ef1dbb9cc4d047f9544 100644 (file)
@@ -6,7 +6,7 @@
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module     WoltLabSuite/Core/Language/Chooser
  */
-define(['Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/SimpleDropdown'], function(Dictionary, Language, DomTraverse, DomUtil, ObjectMap, UiSimpleDropdown) {
+define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/SimpleDropdown'], function(Core, Dictionary, Language, DomTraverse, DomUtil, ObjectMap, UiSimpleDropdown) {
        "use strict";
        
        var _choosers = new Dictionary();
@@ -229,6 +229,7 @@ define(['Dictionary', 'Language', 'Dom/Traverse', 'Dom/Util', 'ObjectMap', 'Ui/S
                        }
                        
                        chooser.element.value = languageId;
+                       Core.triggerEvent(chooser.element, 'change');
                        
                        chooser.dropdownToggle.innerHTML = listItem.firstChild.innerHTML;