From 5357306c92ebf881c01ccc01c98cd66df0d12480 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Thu, 15 May 2025 22:11:01 +0800 Subject: [PATCH] ckeditor fixes --- app/views/admin/curations/_form.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/admin/curations/_form.html.erb b/app/views/admin/curations/_form.html.erb index 5c43700..75e02d4 100644 --- a/app/views/admin/curations/_form.html.erb +++ b/app/views/admin/curations/_form.html.erb @@ -747,8 +747,14 @@ parent.find(".section_type_ut").hide(); if($(this).val() == "text"){ parent.find(".section_type_text").show(); + var id = parent.find(".section_type_text textarea").attr("id"); + CKEDITOR.replace(id); }else if($(this).val() == "universal_table"){ parent.find(".section_type_ut").show(); + if(parent.find(".section_type_text textarea").length > 0){ + var id = parent.find(".section_type_text textarea").attr("id"); + CKEDITOR.instances[id].destroy(true); + } } }) <% if defined? UniversalTable %>