[frontend/components] Use IsNullOrWhiteSpace to check if attachment has alt text
This commit is contained in:
parent
c131efc7c8
commit
ce16fca697
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@
|
|||
</span>
|
||||
}
|
||||
|
||||
@if (Attachment.AltText != null)
|
||||
@if (!string.IsNullOrWhiteSpace(Attachment.AltText))
|
||||
{
|
||||
<button @onclick="DisplayAlt" @onclick:stopPropagation="true" class="alt-btn" title="@Attachment.AltText">
|
||||
<Icon Name="Icons.ClosedCaptioning"/>
|
||||
|
@ -75,6 +75,6 @@
|
|||
|
||||
private async Task DisplayAlt()
|
||||
{
|
||||
await Js.InvokeVoidAsync("alert", Attachment.AltText ?? Loc["No alt text"]);
|
||||
await Js.InvokeVoidAsync("alert", string.IsNullOrWhiteSpace(Attachment.AltText) ? Loc["No alt text"] : Attachment.AltText);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue