[BUGFIX] Always show input field for empty link fields 26/53826/2
authorJohannes Schlier <johannes.schlier@b13.de>
Wed, 23 Aug 2017 14:34:01 +0000 (16:34 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 29 Aug 2017 16:48:50 +0000 (18:48 +0200)
The trigger values can be hardcoded here, as the previous
filtering only gives us fields for which we want to hide
the explanation and show the input field.
Previuosly each time a new link field was created  (as an
IRRE element for example) the input and explanation fields
were triggered. This created confusion with editors and
also broke the trigger button, so that fields that were in
the explanation mode could not be triggered back to input mode.

Resolves: #82179
Releases: master, 8.7
Change-Id: Ic92129c6cdafe5fab19fbc76b9e9b7713b9e8736
Reviewed-on: https://review.typo3.org/53826
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index 7b0f253..315f178 100644 (file)
@@ -1013,12 +1013,10 @@ define(['jquery',
                }).each(function () {
                        var $group = $(this).closest('.t3js-form-field-inputlink'),
                                $inputField = $group.find(inputFieldClass),
-                               $explanationField = $group.find(explanationClass),
-                               explanationShown;
-                       explanationShown = !$explanationField.hasClass('hidden');
-                       $explanationField.toggleClass('hidden', explanationShown);
-                       $inputField.toggleClass('hidden', !explanationShown);
-                       $group.find('.form-control-clearable button.close').toggleClass('hidden', !explanationShown)
+                               $explanationField = $group.find(explanationClass);
+                       $explanationField.toggleClass('hidden', true);
+                       $inputField.toggleClass('hidden', false);
+                       $group.find('.form-control-clearable button.close').toggleClass('hidden', false)
                });
 
                $(document).on('click', toggleClass, function (e) {