From 48c945aa67c03a6ccf2565a4b3d4212168c88d40 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 20 Sep 2016 20:37:37 +0200 Subject: [PATCH] Improved check for missing i18n input values --- .../files/js/WoltLabSuite/Core/Language/Input.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Input.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Input.js index 05e323e377..27b1089cb4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Input.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Language/Input.js @@ -242,6 +242,7 @@ define(['Core', 'Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'Dom/Traver var dropdownMenu = UiSimpleDropdown.getDropdownMenu(containerId); var elementId = elData(elById(containerId), 'input-id'); + var data = _elements.get(elementId); var values = _values.get(elementId); var item, languageId; @@ -250,7 +251,17 @@ define(['Core', 'Dictionary', 'Language', 'ObjectMap', 'StringUtil', 'Dom/Traver languageId = ~~elData(item, 'language-id'); if (languageId) { - item.classList[(values.get(languageId) || !values.size ? 'remove' : 'add')]('missingValue'); + var hasMissingValue = false; + if (data.languageId) { + if (languageId === data.languageId) { + hasMissingValue = (data.element.value.trim() === ''); + } + else { + hasMissingValue = (!values.get(languageId)); + } + } + + item.classList[(hasMissingValue ? 'add' : 'remove')]('missingValue'); } } }, -- 2.20.1