From: Matthias Schmidt Date: Sun, 29 Sep 2019 16:26:19 +0000 (+0200) Subject: Fix form field dependencies on language form fields X-Git-Tag: 5.2.0_Beta_2~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=231598d2e7d45ffc2189f2673e500aab80872225;p=GitHub%2FWoltLab%2FWCF.git Fix form field dependencies on language form fields --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js index ffcb47be97..c0daf156a3 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js @@ -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 { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Chooser.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Chooser.js index 05fb6933f6..20f5fc81d5 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Chooser.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Chooser.js @@ -6,7 +6,7 @@ * @license GNU Lesser General Public License * @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;