diff --git a/view/view_table_renderer.anubis b/view/view_table_renderer.anubis
index a79a9c3..e694295 100644
--- a/view/view_table_renderer.anubis
+++ b/view/view_table_renderer.anubis
@@ -791,7 +791,7 @@ public define List(CXM_Form_Field)
one_line_fields([
message(to_String(format_label(label(_T(s_name), no_help), html_Id("")))+
- ""),
+ ""),
if no_add then
empty
else
@@ -804,19 +804,22 @@ public define List(CXM_Form_Field)
[selector_c([],label(_T(s_name), no_help), html_Id(""), wan(c_name), 1, select.get(db, no_referer, ""), success(init(value)), mandatory), help_line(help, _T)],
text_area(s_name, c_name, value, txt_editor, help) then
- with uid = "_"+generate_random_string(20),
- with id = if txt_editor is { none then "", rich_editor then uid+"_editor"},
+// with uid = "_"+generate_random_string(20),
+// with id = if txt_editor is { none then "", rich_editor then uid+"_editor"},
[
if txt_editor is {
none then empty,
rich_editor then partial(partial_content(
[ js(js_file("ckeditor/ckeditor.js")),
js_inline(jquery_ready(
- " var cke_instance = CKEDITOR.replace( '"+id+"' );
- cke_instance.on('blur', function() { cke_instance.updateElement(); });
+ " console.log('loading CKeditor for "+c_name+"');
+ if(CKEDITOR.instances."+c_name+")
+ CKEDITOR.instances."+c_name+".destroy(true);
+ var cke_instance = CKEDITOR.replace( '"+c_name+"' );
+ cke_instance.on('blur', function() { cke_instance.updateElement(); });
"))],empty))
},
- text_area([],label(_T(s_name), no_help), html_Id(id), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)
+ text_area([],label(_T(s_name), no_help), html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)
],
boolean(s_name, c_name, value, help) then
@@ -1065,7 +1068,9 @@ public define List(CXM_Form_Field)
rich_editor then partial(partial_content(
[js(js_file("ckeditor/ckeditor.js")),
js_inline(jquery_ready(
- " console.log('loading CKeditor');
+ " console.log('loading CKeditor for "+c_name+"');
+ if(CKEDITOR.instances."+c_name+")
+ CKEDITOR.instances."+c_name+".destroy(true);
var cke_instance = CKEDITOR.replace( '"+c_name+"' );"+
//" var cke_instance = CKEDITOR.replace( '"+id+"' );
" cke_instance.on('blur', function() { cke_instance.updateElement(); });
--
libgit2 0.21.4