[BUGFIX] Flexform section container expand / collapse 34/47934/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 27 Apr 2016 11:36:16 +0000 (13:36 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Jun 2017 15:22:43 +0000 (17:22 +0200)
Change-Id: Ie35ced0d902497a6eacf2d3e9a8463cdd2066ac8
Resolves: #71183
Releases: master
Reviewed-on: https://review.typo3.org/47934
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Container/FlexFormSectionContainer.php
typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js

index d86e61f..fb006f6 100644 (file)
@@ -63,7 +63,7 @@ class FlexFormSectionContainer extends AbstractContainer
             $options['flexFormFormPrefix'] = $this->data['flexFormFormPrefix'] . '[' . $flexFormFieldName . ']' . '[el]';
             $options['flexFormContainerName'] = $existingSectionContainerDataStructureType;
             $options['flexFormContainerIdentifier'] = $flexFormContainerIdentifier;
-            $options['flexFormContainerElementCollapsed'] = (bool)$existingContainerData['el']['_TOGGLE'];
+            $options['flexFormContainerElementCollapsed'] = (bool)$flexFormRowData[$flexFormContainerIdentifier]['_TOGGLE'];
             $options['renderType'] = 'flexFormContainerContainer';
             $flexFormContainerContainerResult = $this->nodeFactory->create($options)->render();
             $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $flexFormContainerContainerResult);
index 6a994b5..64f1cf7 100644 (file)
@@ -73,7 +73,12 @@ define(['jquery',
 
                $editor.find('.t3e_modalOverlay').fadeOut({
                        complete: function() {
-                               T3editor.resize(codemirror, $textarea.width(), $textarea.height());
+                               var height = $textarea.height();
+                               // only resize when height is higher than zero, height can be lower than zero with hidden elements.
+                               if (height > 0) {
+                                       T3editor.resize(codemirror, $textarea.width(), $textarea.height());
+                               }
+
                                $(document).trigger('t3editor:init', [codemirror, $editor.find('.t3e_wrap')]);
                                T3editor.instances[index] = codemirror;
                                $textarea.hide();