Change the implementation of NoTools and rename it to ShowToolbar.

This commit is contained in:
Atanas Korchev
2023-07-18 10:08:24 +03:00
parent a2209e73fc
commit b70f1f84be
2 changed files with 6 additions and 3 deletions

View File

@@ -7,13 +7,15 @@
@if(Visible)
{
<div @ref=Element style=@Style @attributes=@Attributes class=@GetCssClass() id=@GetId()>
@if (ShowToolbar)
{
<div class="rz-html-editor-toolbar">
<CascadingValue Value=@this>
@if (ChildContent != null)
{
@ChildContent
}
else if (!NoTools)
else
{
<RadzenHtmlEditorUndo />
<RadzenHtmlEditorRedo />
@@ -51,6 +53,7 @@
}
</CascadingValue>
</div>
}
<RadzenTextArea @ref=@TextArea spellcheck="false" Visible=@(mode == HtmlEditorMode.Source) class="rz-html-editor-source" Value=@Html Change=@SourceChanged />
<div hidden="@(mode != HtmlEditorMode.Design)" @ref=@ContentEditable class="rz-html-editor-content" contenteditable=@(!Disabled) @onfocus=@OnFocus @onblur=@OnBlur></div>
</div>

View File

@@ -19,10 +19,10 @@ namespace Radzen.Blazor
public partial class RadzenHtmlEditor : FormComponent<string>
{
/// <summary>
/// Allows for no-tool HTML editors.
/// Specifies whether to show the toolbar. Set it to false to hide the toolbar. Default value is true.
/// </summary>
[Parameter]
public bool NoTools { get; set; } = false;
public bool ShowToolbar { get; set; } = true;
/// <summary>
/// Gets or sets the mode of the editor.