mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
Disable the export button when no files loaded
This commit is contained in:
parent
9ac7dc062f
commit
22fff845d7
@ -83,18 +83,25 @@ public abstract class DefaultPage : HtmlPage
|
||||
WriteDropdownButton(writer, Localization.MenuExport);
|
||||
using (new Ul(writer).WithClass("dropdown-menu").End())
|
||||
{
|
||||
using (new Li(writer).End())
|
||||
{
|
||||
WritePostLink(writer, "/Export", Localization.MenuExportAll, "dropdown-item");
|
||||
}
|
||||
if (GameFileLoader.IsLoaded)
|
||||
{
|
||||
using (new Li(writer).End())
|
||||
{
|
||||
WritePostLink(writer, "/Export", Localization.MenuExportAll, "dropdown-item");
|
||||
}
|
||||
string version = GameFileLoader.GameBundle.GetMaxUnityVersion().ToString();
|
||||
using (new Li(writer).End())
|
||||
{
|
||||
new A(writer).WithClass("dropdown-item").WithNewTabAttributes().WithHref($"unityhub://{version}").Close(version);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (new Li(writer).End())
|
||||
{
|
||||
new A(writer).WithClass("dropdown-item disabled").WithCustomAttribute("aria-diabled", "true").Close(Localization.MenuExportAll);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using (new Div(writer).WithClass("btn-group dropdown").End())
|
||||
|
||||
@ -194,7 +194,10 @@ public sealed partial class SettingsPage : DefaultPage
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
DropDownItem<T> item = items[i];
|
||||
new P(writer).WithId(CreateUniqueID(id, i)).Close(item.Description);
|
||||
new P(writer)
|
||||
.WithClass("dropdown-description")//Used for CSS selecting
|
||||
.WithId(CreateUniqueID(id, i))
|
||||
.Close(item.Description);
|
||||
}
|
||||
|
||||
static string CreateUniqueID(string selectID, int index)
|
||||
|
||||
@ -34,6 +34,7 @@ footer {
|
||||
margin-top: auto; /* Push the footer to the bottom of the container */
|
||||
}
|
||||
|
||||
.disabled {
|
||||
/* This lets the dropdown descriptions in the settings menu render correctly. */
|
||||
.dropdown-description.disabled {
|
||||
display: none; /* Hide disabled elements */
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user