summaryrefslogtreecommitdiff
path: root/Pages
diff options
context:
space:
mode:
Diffstat (limited to 'Pages')
-rw-r--r--Pages/Component/AboutDialog.razor14
-rw-r--r--Pages/Component/TagSelectDialog.razor16
-rw-r--r--Pages/Component/TagSelectDialog.razor.css1
3 files changed, 22 insertions, 9 deletions
diff --git a/Pages/Component/AboutDialog.razor b/Pages/Component/AboutDialog.razor
index a533fbc..9823761 100644
--- a/Pages/Component/AboutDialog.razor
+++ b/Pages/Component/AboutDialog.razor
@@ -1,4 +1,6 @@
@using System.Reflection
+@using Microsoft.AspNetCore.Hosting
+@inject IHostingEnvironment hostingEnvironment
<Dialog @ref=dialog>
<p id="title">@Title</p>
@@ -686,11 +688,21 @@
public void Hide() => Visible = false;
public string Title =>
- $"HyperBooru v{Version}";
+ $"HyperBooru v{Version} {Development}";
public string? Version =>
GetType()
.Assembly
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
.InformationalVersion;
+
+ public string? Development {
+ get {
+ #if DEBUG
+ return "(Development)";
+ #else
+ return hostingEnvironment.IsDevelopment() ? "(Development)" : null;
+ #endif
+ }
+ }
}
diff --git a/Pages/Component/TagSelectDialog.razor b/Pages/Component/TagSelectDialog.razor
index f1c294c..916a070 100644
--- a/Pages/Component/TagSelectDialog.razor
+++ b/Pages/Component/TagSelectDialog.razor
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="@(nameof(HyperBooru)).styles.css"/>
<Dialog Title=@(Title ?? "Select one or more tag(s)") @ref=dialog>
- <input type="text" placeholder="Search" @ref=queryInput @oninput=QueryInput @onkeypress=QueryKey value=@query autofocus/>
+ <input type="text" placeholder="Search" @ref=queryInput @oninput=QueryInput @onkeypress=QueryKey value=@query/>
<div class="tag-definitions">
@for(int i = 0; i < tagDefinitions.Count(); i++) {
if(!MatchesQuery(tagDefinitions[i].tagDefinition))
@@ -36,14 +36,14 @@
</Dialog>
@code {
- [Parameter]
- public string? Title { get; set; }
+ [Parameter]
+ public string? Title { get; set; }
- [Parameter]
- public EventCallback<TagDefinition[]> OnSubmit { get; set; }
+ [Parameter]
+ public EventCallback<TagDefinition[]> OnSubmit { get; set; }
public TagDefinition[] SelectedTags { get; set; } =
- Array.Empty<TagDefinition>();
+ Array.Empty<TagDefinition>();
public bool Visible {
get => visible;
@@ -74,9 +74,9 @@
LoadTags();
}
- protected override void OnAfterRender(bool firstRender) {
+ protected override async Task OnAfterRenderAsync(bool firstRender) {
if(Visible)
- queryInput.FocusAsync();
+ await Task.Delay(100).ContinueWith(t => queryInput.FocusAsync());
}
private void LoadTags() {
diff --git a/Pages/Component/TagSelectDialog.razor.css b/Pages/Component/TagSelectDialog.razor.css
index 5394dfe..7b50077 100644
--- a/Pages/Component/TagSelectDialog.razor.css
+++ b/Pages/Component/TagSelectDialog.razor.css
@@ -1,4 +1,5 @@
div.tag-definitions {
+ max-height: 450px;
overflow-y: auto;
user-select: none;
}