Skip to content

Commit

Permalink
Issue #2575: Fix AJAX update for richtext dfs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven committed Oct 30, 2023
1 parent 41ce33c commit 75c5b5b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions var/httpd/htdocs/js/Core.AJAX.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,20 @@ Core.AJAX = (function (TargetNS) {
}

// add the text to the RichText editor
if (CKEditorObj && CKEditorObj.instances.RichText) {
CKEditorObj.instances.RichText.focus();
if (CKEditorObj && CKEditorObj.instances[ $Element.attr('id') ]) {
var RichTextArea = CKEditorObj.instances[ $Element.attr('id') ];

if ( $Element.attr('id') === 'RichText' ) {
RichTextArea.focus();
}
window.setTimeout(function () {

// In some circumstances, this command throws an error (although inserting the HTML works)
// Because the intended functionality also works, we just wrap it in a try-catch-statement
try {

// set new text
CKEditorObj.instances.RichText.setData(Value);
RichTextArea.setData(Value);
}
catch (Error) {
$.noop();
Expand Down

0 comments on commit 75c5b5b

Please sign in to comment.