Merge pull request #5871 from leigh-pointer/AltText

Add AltText/title support to ActionDialog and ActionLink
This commit is contained in:
Shaun Walker
2025-12-14 15:15:03 -05:00
committed by GitHub
2 changed files with 13 additions and 7 deletions

View File

@@ -35,11 +35,11 @@
{ {
if (Disabled) if (Disabled)
{ {
<button type="button" class="@Class" disabled>@((MarkupString)_openIconSpan) @_openText</button> <button type="button" class="@Class" title="@AltText" disabled>@((MarkupString)_openIconSpan) @_openText</button>
} }
else else
{ {
<button type="button" class="@Class" @onclick="DisplayModal">@((MarkupString)_openIconSpan) @_openText</button> <button type="button" class="@Class" title="@AltText" @onclick="DisplayModal">@((MarkupString)_openIconSpan) @_openText</button>
} }
} }
} }
@@ -83,13 +83,13 @@ else
{ {
if (Disabled) if (Disabled)
{ {
<button type="button" class="@Class" disabled>@((MarkupString)_openIconSpan) @_openText</button> <button type="button" title="@AltText" class="@Class" disabled>@((MarkupString)_openIconSpan) @_openText</button>
} }
else else
{ {
<form method="post" class="app-form-inline" @formname="@($"ActionDialogActionForm:{ModuleState.PageModuleId}:{Id}")" @onsubmit="DisplayModal" data-enhance> <form method="post" class="app-form-inline" @formname="@($"ActionDialogActionForm:{ModuleState.PageModuleId}:{Id}")" @onsubmit="DisplayModal" data-enhance>
<input type="hidden" name="@Constants.RequestVerificationToken" value="@SiteState.AntiForgeryToken" /> <input type="hidden" name="@Constants.RequestVerificationToken" value="@SiteState.AntiForgeryToken" />
<button type="submit" class="@Class">@((MarkupString)_openIconSpan) @_openText</button> <button type="submit" title="@AltText" class="@Class">@((MarkupString)_openIconSpan) @_openText</button>
</form> </form>
} }
} }
@@ -112,6 +112,9 @@ else
[Parameter] [Parameter]
public string Text { get; set; } // optional - defaults to Action if not specified public string Text { get; set; } // optional - defaults to Action if not specified
[Parameter]
public string AltText { get; set; } // optional
[Parameter] [Parameter]
public string Action { get; set; } // optional public string Action { get; set; } // optional

View File

@@ -8,17 +8,17 @@
{ {
if (Disabled) if (Disabled)
{ {
<NavLink class="@($"{_classname} disabled")" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink> <NavLink class="@($"{_classname} disabled")" title="@AltText" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink>
} }
else else
{ {
if (OnClick == null) if (OnClick == null)
{ {
<NavLink class="@_classname" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink> <NavLink class="@_classname" title="@AltText" href="@_url" style="@_style">@((MarkupString)_iconSpan) @_text</NavLink>
} }
else else
{ {
<button type="button" class="@_classname" style="@_style" onclick="@OnClick">@((MarkupString)_iconSpan) @_text</button> <button type="button" class="@_classname" title="@AltText" style="@_style" onclick="@OnClick">@((MarkupString)_iconSpan) @_text</button>
} }
} }
} }
@@ -42,6 +42,9 @@
[Parameter] [Parameter]
public string Text { get; set; } // optional - defaults to Action if not specified public string Text { get; set; } // optional - defaults to Action if not specified
[Parameter]
public string AltText { get; set; } // optional
[Parameter] [Parameter]
public int ModuleId { get; set; } = -1; // optional - allows the link to target a specific moduleid public int ModuleId { get; set; } = -1; // optional - allows the link to target a specific moduleid