diff --git a/Oqtane.Client/Modules/Controls/RichTextEditor.razor b/Oqtane.Client/Modules/Controls/RichTextEditor.razor
index 60d4fe6d..d3d68870 100644
--- a/Oqtane.Client/Modules/Controls/RichTextEditor.razor
+++ b/Oqtane.Client/Modules/Controls/RichTextEditor.razor
@@ -16,11 +16,14 @@
}
-
-
+
+
+
+ @ToolbarContent
+
+
+
+
@code {
@@ -128,4 +131,4 @@
StateHasChanged();
}
-}
\ No newline at end of file
+}
diff --git a/Oqtane.Client/Modules/HtmlText/Edit.razor b/Oqtane.Client/Modules/HtmlText/Edit.razor
index 7404634e..c5829d05 100644
--- a/Oqtane.Client/Modules/HtmlText/Edit.razor
+++ b/Oqtane.Client/Modules/HtmlText/Edit.razor
@@ -7,64 +7,64 @@
@inject HttpClient http
@inject SiteState sitestate
-
-
-
-
- |
-
- @if (!RichTextEditorMode)
- {
-
- }
- else
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- |
-
-
-@if (!RichTextEditorMode)
-{
-
-}
-else
-{
-
-}
-
-
Cancel
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @if (!RichTextEditorMode)
+ {
+
+ }
+ else
+ {
+
+ }
+
+ Cancel
+
+
+
+
@code {
@@ -78,8 +78,30 @@ else
get { return "Edit Html/Text"; }
}
- bool RichTextEditorMode = true;
- bool _richTextEditorLoading = false;
+ public bool RichTextEditorMode
+ {
+ get => _richTextEditorMode;
+ set
+ {
+ _richTextEditorMode = value;
+
+ if (_richTextEditorMode)
+ {
+ _visibleText = "d-none";
+ _visibleRich = "";
+ }
+ else
+ {
+ _visibleText = "";
+ _visibleRich = "d-none";
+ }
+ }
+ }
+
+ string _visibleText;
+ string _visibleRich;
+ bool _richTextEditorMode;
+
RichTextEditor RichTextEditorHtml;
string content;
string createdby;
@@ -95,17 +117,10 @@ else
{
if (content == null)
{
+ RichTextEditorMode = true;
await LoadText();
}
}
- else
- {
- if (_richTextEditorLoading)
- {
- await RichTextEditorHtml.LoadContent(content);
- _richTextEditorLoading = false;
- }
- }
}
catch (Exception ex)
{
@@ -137,18 +152,15 @@ else
private async Task RichTextEditor()
{
RichTextEditorMode = true;
- _richTextEditorLoading = true;
+ await RichTextEditorHtml.LoadContent(content);
StateHasChanged();
}
private async Task RawHtmlEditor()
{
- if (RichTextEditorMode)
- {
- content = await this.RichTextEditorHtml.GetHTML();
- }
+ content = await this.RichTextEditorHtml.GetHTML();
RichTextEditorMode = false;
- // await LoadText();
+ StateHasChanged();
}
private async Task SaveContent()