Bugfix: CKEditor failed to load

This commit is contained in:
djmaze 2020-09-23 11:20:00 +02:00
parent 3599c4c745
commit 65032e3b89
5 changed files with 205 additions and 248 deletions

View file

@ -1,5 +1,5 @@
(function(CKEDITOR, $) {
(function(CKEDITOR) {
'use strict';
@ -10,10 +10,10 @@
isEmptyText = false,
newLine = (isHtml ? '<br />' : "\n"),
clearHtmlLine = function(html) {
return $.trim(editor.__textUtils.htmlToPlain(html));
return editor.__textUtils.htmlToPlain(html).trim();
};
isEmptyText = !$.trim(text);
isEmptyText = !text.trim();
if (!isEmptyText && isHtml)
{
isEmptyText = !clearHtmlLine(text);
@ -138,4 +138,4 @@
}
});
}(CKEDITOR, $));
}(CKEDITOR));