diff --git a/Oqtane.Client/Modules/Controls/ActionDialog.razor b/Oqtane.Client/Modules/Controls/ActionDialog.razor index 1125d7b0..defb520d 100644 --- a/Oqtane.Client/Modules/Controls/ActionDialog.razor +++ b/Oqtane.Client/Modules/Controls/ActionDialog.razor @@ -35,11 +35,11 @@ { if (Disabled) { - + } else { - + } } } @@ -83,13 +83,13 @@ else { if (Disabled) { - + } else {
- +
} } @@ -101,6 +101,8 @@ else private bool _editmode = false; private bool _authorized = false; private string _iconSpan = string.Empty; + private string _openIconSpan = string.Empty; + private string _openText = string.Empty; [Parameter] public string Header { get; set; } // required @@ -138,6 +140,9 @@ else [Parameter] public string IconName { get; set; } // optional - specifies an icon for the link - default is no icon + [Parameter] + public bool IconOnly { get; set; } // optional - specifies only icon in opening link + [Parameter] public string Id { get; set; } // optional - specifies a unique id for the compoment - required when there are multiple component instances on a page in static rendering @@ -157,6 +162,8 @@ else { Text = Action; } + _openText = Text; + if (string.IsNullOrEmpty(Class)) { Class = "btn btn-success"; @@ -169,11 +176,17 @@ else if (!string.IsNullOrEmpty(IconName)) { + if (IconOnly) + { + _openText = string.Empty; + } + if (!IconName.Contains(" ")) { IconName = "oi oi-" + IconName; } - _iconSpan = $" "; + _openIconSpan = $"{(IconOnly ? "" : " ")}"; + _iconSpan = $" "; } Text = Localize(nameof(Text), Text);