Commit 5e720a3f9214f7b8a03c0d51da3823fd4e7eddf8
1 parent
25d77d40
Add dialog uid as prefix for CKeditor. This prevent to have multiple CKeditor with same ID
Showing
1 changed file
with
9 additions
and
8 deletions
Show diff stats
view/view_table_renderer.anubis
| ... | ... | @@ -733,7 +733,8 @@ public define List(CXM_Form_Field) |
| 733 | 733 | Bool new_entry, |
| 734 | 734 | Bool no_add, |
| 735 | 735 | VTM vtm, |
| 736 | - List(CXM_Form_Field) so_far | |
| 736 | + List(CXM_Form_Field) so_far, | |
| 737 | + String dialog_uid | |
| 737 | 738 | )= |
| 738 | 739 | if list is |
| 739 | 740 | { |
| ... | ... | @@ -877,14 +878,14 @@ public define List(CXM_Form_Field) |
| 877 | 878 | rich_editor then partial(partial_content( |
| 878 | 879 | [ js(js_file("ckeditor/ckeditor.js")), |
| 879 | 880 | js_inline(jquery_ready( |
| 880 | - " console.log('loading CKeditor for "+c_name+"'); | |
| 881 | - if(CKEDITOR.instances."+c_name+") | |
| 882 | - CKEDITOR.instances."+c_name+".destroy(true); | |
| 883 | - var cke_instance = CKEDITOR.replace( '"+c_name+"' ); | |
| 881 | + " console.log('loading CKeditor for "+dialog_uid+"_"+c_name+"'); | |
| 882 | + if(CKEDITOR.instances."+dialog_uid+"_"+c_name+") | |
| 883 | + CKEDITOR.instances."+dialog_uid+"_"+c_name+".destroy(true); | |
| 884 | + var cke_instance = CKEDITOR.replace( '"+dialog_uid+"_"+c_name+"' ); | |
| 884 | 885 | cke_instance.on('blur', function() { cke_instance.updateElement(); }); |
| 885 | 886 | "))],empty)) |
| 886 | 887 | }, |
| 887 | - 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) | |
| 888 | + text_area([],label(_T(s_name), no_help), html_Id(dialog_uid+"_"+c_name), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T) | |
| 888 | 889 | ], |
| 889 | 890 | |
| 890 | 891 | boolean(s_name, c_name, value, help) then |
| ... | ... | @@ -915,7 +916,7 @@ public define List(CXM_Form_Field) |
| 915 | 916 | url( s_name, c_name, value, help) then |
| 916 | 917 | [url_input([event(onclick, "hk_go_url(this)")], [class("hk_input_url")], label(_T(s_name), no_help), html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, mandatory), help_line(help, _T)], |
| 917 | 918 | }, |
| 918 | - edit_form_lines(db, fk_clause, table_referer, lwa, _T, t, new_entry, no_add, vtm, reverse(line)+so_far) | |
| 919 | + edit_form_lines(db, fk_clause, table_referer, lwa, _T, t, new_entry, no_add, vtm, reverse(line)+so_far, dialog_uid) | |
| 919 | 920 | }. |
| 920 | 921 | |
| 921 | 922 | |
| ... | ... | @@ -983,7 +984,7 @@ public define HTML_Partial_Content |
| 983 | 984 | [] |
| 984 | 985 | ) |
| 985 | 986 | + |
| 986 | - edit_form_lines(db, "", table_referer, lwa, _T, list_entries, create, no_add, vtm, []) | |
| 987 | + edit_form_lines(db, "", table_referer, lwa, _T, list_entries, create, no_add, vtm, [], form_id) | |
| 987 | 988 | + |
| 988 | 989 | (if id = "none" then |
| 989 | 990 | [] | ... | ... |