parent
9e4e1edd8d
commit
7aabecb882
1 changed files with 8 additions and 3 deletions
|
@ -10,11 +10,11 @@
|
||||||
RenderFragment Footer =
|
RenderFragment Footer =
|
||||||
@<Template>
|
@<Template>
|
||||||
<Button OnClick="Save" Disabled="@(String.IsNullOrWhiteSpace(Script.Name))" Type="@ButtonType.Primary">Save</Button>
|
<Button OnClick="Save" Disabled="@(String.IsNullOrWhiteSpace(Script.Name))" Type="@ButtonType.Primary">Save</Button>
|
||||||
<Button OnClick="() => ModalVisible = false">Close</Button>
|
<Button OnClick="Close">Close</Button>
|
||||||
</Template>;
|
</Template>;
|
||||||
}
|
}
|
||||||
|
|
||||||
<Modal Visible="ModalVisible" Footer="@Footer" Title="@(Script == null ? "Add Script" : "Edit Script")" OkText="@("Save")" Maximizable="false" DefaultMaximized="true" Closable="true">
|
<Modal Visible="ModalVisible" Footer="@Footer" Title="@(Script == null ? "Add Script" : "Edit Script")" OkText="@("Save")" Maximizable="false" DefaultMaximized="true" Closable="true" OnCancel="Close">
|
||||||
<Form Model="@Script" Layout="@FormLayout.Vertical">
|
<Form Model="@Script" Layout="@FormLayout.Vertical">
|
||||||
<FormItem>
|
<FormItem>
|
||||||
@foreach (var group in Snippets.Select(s => s.Group).Distinct())
|
@foreach (var group in Snippets.Select(s => s.Group).Distinct())
|
||||||
|
@ -167,6 +167,11 @@
|
||||||
await MessageService.Success("Script deleted!");
|
await MessageService.Success("Script deleted!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Close()
|
||||||
|
{
|
||||||
|
ModalVisible = false;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task Save()
|
private async Task Save()
|
||||||
{
|
{
|
||||||
var value = await Editor.GetValue();
|
var value = await Editor.GetValue();
|
||||||
|
@ -178,7 +183,7 @@
|
||||||
else
|
else
|
||||||
Script = await ScriptService.Update(Script);
|
Script = await ScriptService.Update(Script);
|
||||||
|
|
||||||
ModalVisible = false;
|
Close();
|
||||||
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue