diff --git a/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php b/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php index a460f05176bdba6b55d398ad3b0d38940621a3e3..cb02e03fbb3ca2b2af01382852a86b7efdfc01d7 100644 --- a/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php +++ b/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php @@ -123,6 +123,7 @@ class T3editorElement extends AbstractFormElement $this->data['tableName'] . ' > ' . $this->data['fieldName'], array('target' => 0) ); + $this->resultArray['additionalJavaScriptPost'][] = 'require(["TYPO3/CMS/T3editor/T3editor"], function(T3editor) {T3editor.findAndInitializeEditors();});'; $this->initJavascriptCode(); return $this->resultArray; @@ -158,7 +159,6 @@ class T3editorElement extends AbstractFormElement protected function initJavascriptCode() { $this->resultArray['stylesheetFiles'][] = $this->relExtPath . 'Resources/Public/Css/t3editor.css'; - $this->resultArray['requireJsModules'][] = 'TYPO3/CMS/T3editor/T3editor'; if ($this->mode === self::MODE_TYPOSCRIPT) { foreach ($this->codeCompletionComponents as $codeCompletionComponent) { $this->resultArray['requireJsModules'][] = 'TYPO3/CMS/T3editor/Plugins/CodeCompletion/' . $codeCompletionComponent; diff --git a/typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js b/typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js index 7fe92bff54c57f93204c0aac28d797efaafb6dd4..6a994b54e2de88b9b0c3614cda2166adc7f00f91 100644 --- a/typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js +++ b/typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js @@ -45,6 +45,9 @@ define(['jquery', * @param {Number} index */ T3editor.initializeEditor = function($editor, index) { + if ($editor.data('initialized')) { + return; + } var $textarea = $editor.find('textarea'), options = { labels: $textarea.data('labels'), @@ -76,6 +79,7 @@ define(['jquery', $textarea.hide(); } }); + $editor.data('initialized', true); }; /**