Browse Source

fix media card selection (#1840)

pull/1842/head
Jason Dove 1 year ago committed by GitHub
parent
commit
8dc1cab222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      ErsatzTV/Shared/MediaCard.razor

17
ErsatzTV/Shared/MediaCard.razor

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
@using ErsatzTV.Application.MediaCards
@using static Prelude
@inject IMediator Mediator
@inject NavigationManager NavigationManager
<div class="@((ContainerClass ?? "media-card-container mr-6") + " pb-3")" id="@($"item_{Data.MediaItemId}")">
@if (SelectClicked.HasDelegate || !string.IsNullOrWhiteSpace(Href))
@ -36,9 +37,8 @@ @@ -36,9 +37,8 @@
</div>
}
<div class="media-card-overlay" style="">
<MudButton Href="@(IsSelectMode ? null : Href)"
Style="height: 100%; width: 100%"
OnClick="@(e => IsSelectMode || string.IsNullOrWhiteSpace(Href) ? SelectClicked.InvokeAsync(e) : Task.CompletedTask)">
<MudButton Style="height: 100%; width: 100%"
OnClick="OnOverlayClick">
</MudButton>
@if (SelectClicked.HasDelegate)
{
@ -162,4 +162,15 @@ @@ -162,4 +162,15 @@
_ => "posters"
};
private void OnOverlayClick(MouseEventArgs e)
{
if (IsSelectMode || string.IsNullOrWhiteSpace(Href))
{
SelectClicked.InvokeAsync(e);
}
else
{
NavigationManager.NavigateTo(Href);
}
}
}
Loading…
Cancel
Save