From 231598d2e7d45ffc2189f2673e500aab80872225 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 29 Sep 2019 18:26:19 +0200 Subject: [PATCH] Fix form field dependencies on language form fields --- .../WoltLabSuite/Core/Form/Builder/Field/Dependency/Manager.js | 2 +- .../install/files/js/WoltLabSuite/Core/Language/Chooser.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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; -- 2.20.1