Skip to content

Commit

Permalink
Issue #3584: improved richtext performance on large emails
Browse files Browse the repository at this point in the history
the data copying seems to cause a huge chunk of the lag, so i moved this into the timeout. i also increased timeout to half a second as that should be sufficient.
  • Loading branch information
chzauleck committed Sep 12, 2024
1 parent 9be6621 commit ea51116
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions var/httpd/htdocs/js/Core.UI.RichTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ Core.UI.RichTextEditor = (function (TargetNS) {

//Update validation error tooltip while content is added to the editor
editor.model.document.on('change:data', () => {
if (editor.getData() != "") {
$("#" + editor.ElementId).val(editor.getData());
}

window.clearTimeout(TimeOutRTEOnChange);
TimeOutRTEOnChange = window.setTimeout(function () {
let EditorAreaContent = editor.getData();
if (EditorAreaContent != "") {
$("#" + editor.ElementId).val(EditorAreaContent);
}
Core.Form.Validate.ValidateElement($EditorArea);
Core.App.Publish('Event.UI.RichTextEditor.ChangeValidationComplete', [editor]);
}, 250);
}, 500);
});

editor.ui.focusTracker.on('change:isFocused', (evt, name, isFocused) => {
Expand Down

0 comments on commit ea51116

Please sign in to comment.