From f3b5188a1af920ae7ec9060e1b615746c454c6e6 Mon Sep 17 00:00:00 2001 From: Arcady Usov Date: Sun, 13 Apr 2014 23:53:47 +0600 Subject: [PATCH] Fix "add-row" link in admin inline for initial CKEditor when it's placed in new row admin inline. --- .../templates/cms/plugins/widgets/ckeditor.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html b/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html index 969d87a..b39e055 100644 --- a/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html +++ b/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html @@ -51,6 +51,18 @@ $(document).ready(function () { // initialize ckeditor only if the container exists and is ready initCMSCKEditor(); + + // initialize ckeditor in admin inline for "add-row" link + if ($('.add-row a').length > 0) { + $('.add-row a').each(function() { + if ($(this).data('isInitCMSCKEditor') != 'yes') { + $(this).click(function() { + initCMSCKEditor(); + }); + $(this).data('isInitCMSCKEditor', 'yes'); + } + }) + } }); })(CMS.$);