Merge pull request #1883 from leigh-pointer/RichTextContent
Rework to #1848 RawHTML not being saved
This commit is contained in:
commit
bf56c2a9fa
@ -120,19 +120,20 @@
|
|||||||
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
|
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js" }
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
_content = Content; // raw HTML
|
_content = Content; // raw HTML
|
||||||
|
await RefreshRichText();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
{
|
{
|
||||||
var interop = new RichTextEditorInterop(JSRuntime);
|
var interop = new RichTextEditorInterop(JSRuntime);
|
||||||
|
if (firstRender)
|
||||||
if (firstRender)
|
|
||||||
{
|
{
|
||||||
await base.OnAfterRenderAsync(firstRender);
|
await base.OnAfterRenderAsync(firstRender);
|
||||||
|
|
||||||
|
|
||||||
await interop.CreateEditor(
|
await interop.CreateEditor(
|
||||||
_editorElement,
|
_editorElement,
|
||||||
_toolBar,
|
_toolBar,
|
||||||
@ -140,15 +141,14 @@
|
|||||||
Placeholder,
|
Placeholder,
|
||||||
Theme,
|
Theme,
|
||||||
DebugLevel);
|
DebugLevel);
|
||||||
|
|
||||||
|
await interop.LoadEditorContent(_editorElement, Content);
|
||||||
|
|
||||||
|
_content = Content; // raw HTML
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
|
||||||
await interop.LoadEditorContent(_editorElement, Content);
|
_original = await interop.GetHtml(_editorElement);
|
||||||
|
|
||||||
_content = Content; // raw HTML
|
|
||||||
|
|
||||||
// preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
|
|
||||||
_original = await interop.GetHtml(_editorElement);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseFileManager()
|
public void CloseFileManager()
|
||||||
|
Reference in New Issue
Block a user