[TASK] Automatically select the custom preset when values are changed 94/48394/5
authorMarkus Klein <markus.klein@typo3.org>
Sun, 29 May 2016 13:59:38 +0000 (15:59 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Mon, 30 May 2016 13:43:54 +0000 (15:43 +0200)
If the user changes a field in a custom preset in the Install Tool
the custom preset's radio box must be selected too.

Resolves: #76365
Releases: master, 7.6
Change-Id: Iee499d61574e88ef094d690bea7ff827aa7507dc
Reviewed-on: https://review.typo3.org/48394
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Configuration/Context/Custom.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Configuration/Image/Custom.html
typo3/sysext/install/Resources/Private/Partials/Action/Tool/Configuration/Mail/Custom.html
typo3/sysext/install/Resources/Public/JavaScript/Install.js

index 2a50e95..7b9d137 100644 (file)
@@ -33,7 +33,8 @@
                                                type="input"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control"
+                                               class="form-control t3js-custom-preset"
+                                               data-radio="t3-install-tool-configuration-context-custom"
                                        />
                                </div>
                        </div>
index 133d506..deda64c 100644 (file)
@@ -33,7 +33,8 @@
                                                type="input"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control"
+                                               class="form-control t3js-custom-preset"
+                                               data-radio="t3-install-tool-configuration-image-custom"
                                        />
                                </div>
                        </div>
index 28fe86e..9531c82 100644 (file)
@@ -4,13 +4,13 @@
                        <input
                                type="radio"
                                class="t3-install-tool-configuration-radio"
-                               id="t3-install-tool-configuration-charset-custom"
+                               id="t3-install-tool-configuration-mail-custom"
                                name="install[values][{feature.name}][enable]"
                                value="{preset.name}"
                                {f:if(condition:'{preset.isActive}', then:'checked="checked"')}
                        />
                        <label
-                               for="t3-install-tool-configuration-charset-custom"
+                               for="t3-install-tool-configuration-mail-custom"
                                class="t3-install-tool-configuration-radio-label"
                                >
                                <strong>
@@ -33,7 +33,8 @@
                                                type="input"
                                                name="install[values][{feature.name}][{preset.name}][{configurationKey}]"
                                                value="{configurationValue}"
-                                               class="form-control"
+                                               class="form-control t3js-custom-preset"
+                                               data-radio="t3-install-tool-configuration-mail-custom"
                                                />
                                </div>
                        </div>
index bfac527..aad6583 100644 (file)
@@ -675,4 +675,9 @@ $(function() {
                        TYPO3.Install.Scrolling.handleButtonScrolling();
                }, 50);
        });
+
+       // automatically select the custom preset if a value in one of its input fields is changed
+       $('.t3js-custom-preset').on('change', function () {
+               $('#' + $(this).data('radio')).prop('checked', true);
+       });
 });