[BUGFIX] Clean preview of collapsed flexform section 49/48949/5
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 12 Jul 2016 22:13:26 +0000 (00:13 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 14 Jul 2016 08:07:06 +0000 (10:07 +0200)
The preview state of a collapsed flexform section is cleaned from
HTML tags and the length of each part is limited.

Resolves: #76616
Releases: master, 7.6
Change-Id: Ie896db0863120b452eff80b607c7bf5c58a8879e
Reviewed-on: https://review.typo3.org/48949
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Jorgen van der Kroon <jurgen@alternet.nl>
Tested-by: Jorgen van der Kroon <jurgen@alternet.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineFlexForm.js

index 8ff2642..4722014 100644 (file)
@@ -210,7 +210,11 @@ define(['jquery',
 
                if (!$contentEl.is(':visible')) {
                        $contentEl.find('input[type=text], textarea').each(function() {
-                               previewContent += (previewContent ? ' / ' : '') + $(this).val();
+                               var content = $($.parseHTML($(this).val())).text();
+                               if (content.length > 50) {
+                                       content = content.substring(0, 50) + '...';
+                               }
+                               previewContent += (previewContent ? ' / ' : '') + content;
                        });
                }