diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js index aedb5aa372..3a279d3dd2 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js @@ -174,17 +174,16 @@ }); var shorDescriptionEdited = false; - $pageContentInput.on('change', function () { + + function reflectContentChanges(htmlContent) { if (shorDescriptionEdited) { return; } - var htmlValue = $pageContentInput.val(); - - var plainValue = jQuery('
').html(htmlValue).text().replace(/\n/g, ' ').substring(0, 120); + var plainValue = jQuery('
').html(htmlContent).text().replace(/\n/g, ' ').substring(0, 120); $shortDescription.val(plainValue); - }); + } $shortDescription.on('change', function () { shorDescriptionEdited = true; @@ -243,6 +242,8 @@ change: function (_val) { $editorInput.val(editor.getMarkdown()); $editorInput.trigger("change"); + debugger; + reflectContentChanges(editor.getHtml()); } } }).data(editorDataKey);