diff --git a/Oqtane.Client/Modules/HtmlText/Edit.razor b/Oqtane.Client/Modules/HtmlText/Edit.razor
index f534eb7f..af7340c9 100644
--- a/Oqtane.Client/Modules/HtmlText/Edit.razor
+++ b/Oqtane.Client/Modules/HtmlText/Edit.razor
@@ -13,38 +13,53 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ @if (!RichTextEditorMode)
+ {
+
+ }
+ else
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
|
+@if (!RichTextEditorMode)
+{
+
+}
+else
+{
+
+}
Cancel
@@ -56,6 +71,7 @@
public override string Title { get { return "Edit Html/Text"; } }
RichTextEditor RichTextEditorHtml;
+ bool RichTextEditorMode = true;
string content;
string createdby;
DateTime createdon;
@@ -66,19 +82,7 @@
{
try
{
- HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
- HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
-
- if (htmltext != null)
- {
- content = htmltext.Content;
- createdby = htmltext.CreatedBy;
- createdon = htmltext.CreatedOn;
- modifiedby = htmltext.ModifiedBy;
- modifiedon = htmltext.ModifiedOn;
-
- await RichTextEditorHtml.LoadContent(content);
- }
+ await LoadText();
}
catch (Exception ex)
{
@@ -87,9 +91,43 @@
}
}
+ private async Task LoadText()
+ {
+ HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
+ HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
+ if (htmltext != null)
+ {
+ content = htmltext.Content;
+ createdby = htmltext.CreatedBy;
+ createdon = htmltext.CreatedOn;
+ modifiedby = htmltext.ModifiedBy;
+ modifiedon = htmltext.ModifiedOn;
+
+ if (RichTextEditorMode)
+ {
+ await RichTextEditorHtml.LoadContent(content);
+ }
+ }
+ }
+
+ private async Task RichTextEditor()
+ {
+ RichTextEditorMode = true;
+ await LoadText();
+ }
+
+ private async Task RawHTMLEditor()
+ {
+ RichTextEditorMode = false;
+ await LoadText();
+ }
+
private async Task SaveContent()
{
- content = await this.RichTextEditorHtml.GetHTML();
+ if (RichTextEditorMode)
+ {
+ content = await this.RichTextEditorHtml.GetHTML();
+ }
try
{