[BUGFIX] Always show input field for empty link fields 90/53790/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 15:26:03 +0000 (17:26 +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/53790
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Sascha Rademacher <sascha.rademacher+typo3@gmail.com>
Reviewed-by: Anja Leichsenring <anja.leichsenring@typo3.com>
Tested-by: Anja Leichsenring <anja.leichsenring@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>

index b582a7c..4a01cbb 100644 (file)
@@ -1073,12 +1073,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) {