From 9531c0f0e141f2d6dcb0e7348955ed8aba99fd72 Mon Sep 17 00:00:00 2001 From: rulingcom Date: Mon, 19 May 2025 21:52:46 +0800 Subject: [PATCH] small fix --- app/views/admin/curations/_form.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/admin/curations/_form.html.erb b/app/views/admin/curations/_form.html.erb index ec93d65..dfd5b23 100644 --- a/app/views/admin/curations/_form.html.erb +++ b/app/views/admin/curations/_form.html.erb @@ -747,13 +747,17 @@ 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); + parent.find(".section_type_text textarea").each(function(index){ + id = $(this).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); + parent.find(".section_type_text textarea").each(function(index){ + id = $(this).attr("id"); + CKEDITOR.instances[id].destroy(true); + }); } } })