From 0fcda98b9fcab457f9eaa23003f30d21e1df66bd Mon Sep 17 00:00:00 2001 From: Gordon Pedersen Date: Fri, 5 Jul 2024 17:18:46 +1000 Subject: [PATCH] Customizing the markdown editor toolbar --- Components/Pages/EditProfile.razor | 27 ++++++++++++++++++++++++++- Components/_Imports.razor | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Components/Pages/EditProfile.razor b/Components/Pages/EditProfile.razor index 43612e5..8a0970c 100644 --- a/Components/Pages/EditProfile.razor +++ b/Components/Pages/EditProfile.razor @@ -2,13 +2,32 @@ @inject NavigationManager Nav @inject RestService api @inject State State +@inject IJSRuntime JS
+ MaxHeight="100%" + CustomButtonClicked="@OnCustomButtonClicked"> + + + + + + + + + + + + + + +
@@ -80,4 +99,10 @@ loading = false; } + + public async Task OnCustomButtonClicked(MarkdownButtonEventArgs eventArgs) { + if (eventArgs.Name == "Help") { + await JS.InvokeVoidAsync("open", "https://home.omg.lol/info/editor", "_blank"); + } + } } diff --git a/Components/_Imports.razor b/Components/_Imports.razor index db49f5b..b6f0f60 100644 --- a/Components/_Imports.razor +++ b/Components/_Imports.razor @@ -14,3 +14,4 @@ @using Markdig @using PSC.Blazor.Components.MarkdownEditor @using PSC.Blazor.Components.MarkdownEditor.EventsArgs +@using PSC.Blazor.Components.MarkdownEditor.Enums