mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
27 lines
762 B
Plaintext
27 lines
762 B
Plaintext
@using System.Text
|
|
@using Radzen.Blazor.Rendering
|
|
@using Microsoft.JSInterop
|
|
@inherits RadzenHtmlEditorButtonBase
|
|
@inject DialogService DialogService
|
|
@inject IJSRuntime JSRuntime
|
|
|
|
<EditorButton Title=@Title Click=@OnClick Icon="code" PreventBlur=false Selected=@(Editor?.GetMode() == HtmlEditorMode.Source) EnabledModes="HtmlEditorMode.Design | HtmlEditorMode.Source" />
|
|
@code {
|
|
|
|
protected override async Task OnClick()
|
|
{
|
|
if (Editor != null)
|
|
{
|
|
if (Editor.GetMode() == HtmlEditorMode.Design)
|
|
{
|
|
Editor.SetMode(HtmlEditorMode.Source);
|
|
}
|
|
else
|
|
{
|
|
Editor.SetMode(HtmlEditorMode.Design);
|
|
}
|
|
}
|
|
|
|
await Task.CompletedTask;
|
|
}
|
|
} |