From dfd6223cadb420c805308f4c44dca7dc6aeac150 Mon Sep 17 00:00:00 2001 From: Joeri Verdeyen Date: Wed, 30 Jul 2014 10:34:10 +0200 Subject: [PATCH] Only destroy CKEDITOR with class = rich_editor --- .../views/PagePartAdminTwigExtension/widget.html.twig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Resources/views/PagePartAdminTwigExtension/widget.html.twig b/Resources/views/PagePartAdminTwigExtension/widget.html.twig index d5034e6..201c4c5 100755 --- a/Resources/views/PagePartAdminTwigExtension/widget.html.twig +++ b/Resources/views/PagePartAdminTwigExtension/widget.html.twig @@ -99,9 +99,12 @@ } function disableCKEditors(){ - for ( instance in CKEDITOR.instances ){ - CKEDITOR.instances[instance].destroy(); - } + for ( instance in CKEDITOR.instances ){ + if ($('#' + CKEDITOR.instances[instance].name).hasClass('rich_editor')) { + CKEDITOR.instances[instance].destroy(); + + } + } } function enableCKEditors(){