From ad031cb375deb857f85da9499ebbfde2e67ae995 Mon Sep 17 00:00:00 2001 From: Mike Casas Date: Mon, 23 Mar 2020 10:24:54 -0400 Subject: [PATCH] Added functionality to add icons to the ActionLinks. --- Oqtane.Client/Modules/Controls/ActionLink.razor | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/ActionLink.razor b/Oqtane.Client/Modules/Controls/ActionLink.razor index 8f6459aa..5755c4c0 100644 --- a/Oqtane.Client/Modules/Controls/ActionLink.razor +++ b/Oqtane.Client/Modules/Controls/ActionLink.razor @@ -6,11 +6,11 @@ { if (Disabled) { - @_text + @((MarkupString)_iconSpan) @_text } else { - @_text + @((MarkupString)_iconSpan) @_text } } @@ -39,6 +39,9 @@ [Parameter] public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true + [Parameter] + public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon + string _text = ""; string _url = ""; string _parameters = ""; @@ -46,6 +49,7 @@ string _style = ""; bool _editmode = true; bool _authorized = false; + string _iconSpan = ""; protected override void OnParametersSet() { @@ -75,6 +79,11 @@ _editmode = bool.Parse(EditMode); } + if (!string.IsNullOrEmpty(IconName)) + { + _iconSpan = $" "; + } + _url = EditUrl(Action, _parameters); _authorized = IsAuthorized(); }