enter to submit all dialogs (#168)
This commit is contained in:
@@ -2,28 +2,30 @@
|
||||
@using ErsatzTV.Application.ProgramSchedules.Queries
|
||||
@inject IMediator Mediator
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer Class="mb-6">
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
<MudSelect Label="Schedule" @bind-Value="_selectedSchedule" For="@(() => _selectedSchedule)" Class="mb-6 mx-4">
|
||||
@foreach (ProgramScheduleViewModel schedule in _schedules)
|
||||
{
|
||||
<MudSelectItem Value="@schedule">@schedule.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Disabled="@(_selectedSchedule == null)" OnClick="Submit">
|
||||
Add To Schedule
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
<div @onkeydown="@OnKeyDown">
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer Class="mb-6">
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
<MudSelect Label="Schedule" @bind-Value="_selectedSchedule" For="@(() => _selectedSchedule)" Class="mb-6 mx-4">
|
||||
@foreach (ProgramScheduleViewModel schedule in _schedules)
|
||||
{
|
||||
<MudSelectItem Value="@schedule">@schedule.Name</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Primary" Variant="Variant.Filled" Disabled="@(_selectedSchedule == null)" OnClick="Submit">
|
||||
Add To Schedule
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -54,5 +56,13 @@
|
||||
private void Submit() => MudDialog.Close(DialogResult.Ok(_selectedSchedule));
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Code is "Enter" or "NumpadEnter")
|
||||
{
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,26 +1,28 @@
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer>
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
@if (!string.IsNullOrWhiteSpace(DetailText))
|
||||
{
|
||||
<MudContainer Class="mt-3">
|
||||
<div @onkeydown="@OnKeyDown">
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer>
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@DetailText"
|
||||
HighlightedText="@DetailHighlight"/>
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">Delete</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
@if (!string.IsNullOrWhiteSpace(DetailText))
|
||||
{
|
||||
<MudContainer Class="mt-3">
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@DetailText"
|
||||
HighlightedText="@DetailHighlight"/>
|
||||
</MudContainer>
|
||||
}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">Delete</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -44,5 +46,13 @@
|
||||
private void Submit() => MudDialog.Close(DialogResult.Ok(true));
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Code is "Enter" or "NumpadEnter")
|
||||
{
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
@inject IMediator Mediator
|
||||
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer Class="mb-6">
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">
|
||||
Remove From Collection
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
<div @onkeydown="@OnKeyDown">
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer Class="mb-6">
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="@FormatText()"
|
||||
HighlightedText="@EntityName"/>
|
||||
</MudContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">
|
||||
Remove From Collection
|
||||
</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -39,5 +41,13 @@
|
||||
private void Submit() => MudDialog.Close(DialogResult.Ok(true));
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Code is "Enter" or "NumpadEnter")
|
||||
{
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer>
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="Do you really want to sign out of Plex? All synchronized content will be removed."/>
|
||||
</MudContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">Sign out</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
<div @onkeydown="@OnKeyDown">
|
||||
<MudDialog>
|
||||
<DialogContent>
|
||||
<MudContainer>
|
||||
<MudHighlighter Class="mud-primary-text"
|
||||
Style="background-color: transparent; font-weight: bold"
|
||||
Text="Do you really want to sign out of Plex? All synchronized content will be removed."/>
|
||||
</MudContainer>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudButton OnClick="Cancel">Cancel</MudButton>
|
||||
<MudButton Color="Color.Error" Variant="Variant.Filled" OnClick="Submit">Sign out</MudButton>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -21,4 +23,11 @@
|
||||
|
||||
private void Cancel() => MudDialog.Cancel();
|
||||
|
||||
private void OnKeyDown(KeyboardEventArgs e)
|
||||
{
|
||||
if (e.Code is "Enter" or "NumpadEnter")
|
||||
{
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user