[BUGFIX] Re-Init CKEditor after re-sorting of inline records
[Packages/TYPO3.CMS.git] / typo3 / sysext / rte_ckeditor / Classes / Form / Element / RichTextElement.php
index 0695b77..c60afd4 100644 (file)
@@ -190,6 +190,14 @@ class RichTextElement extends AbstractFormElement
                             FormEngine.Validation.validate();
                             FormEngine.Validation.markFieldAsChanged($(\'#' . $fieldId . '\'));
                         });
+                        $(document).on(\'inline:sorting-changed\', function() {
+                            CKEDITOR.instances["' . $fieldId . '"].destroy();
+                            CKEDITOR.replace("' . $fieldId . '", ' . json_encode($configuration) . ');
+                        });
+                        $(document).on(\'flexform:sorting-changed\', function() {
+                            CKEDITOR.instances["' . $fieldId . '"].destroy();
+                            CKEDITOR.replace("' . $fieldId . '", ' . json_encode($configuration) . ');
+                        });
                     });
                 });
         }';