Skip to content

Commit

Permalink
Hide buttons on the Commands page when unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Feb 25, 2024
1 parent 6ab4327 commit 6231dc0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Source/AssetRipper.GUI.Web/Pages/CommandsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ public override void WriteInnerContent(TextWriter writer)
new Input(writer).WithCustomAttribute("v-if", "load_path_exists").WithType("submit").WithClass("btn btn-primary").WithValue(Localization.MenuLoad).Close();
new Button(writer).WithCustomAttribute("v-else").WithClass("btn btn-primary").WithCustomAttribute("disabled").Close(Localization.MenuLoad);
}
new Button(writer).WithCustomAttribute("@click", "handleSelectLoadFile").WithClass("btn btn-success").Close(Localization.SelectFile);
new Button(writer).WithCustomAttribute("@click", "handleSelectLoadFolder").WithClass("btn btn-success").Close(Localization.SelectFolder);

if (Dialogs.Supported)
{
new Button(writer).WithCustomAttribute("@click", "handleSelectLoadFile").WithClass("btn btn-success").Close(Localization.SelectFile);
new Button(writer).WithCustomAttribute("@click", "handleSelectLoadFolder").WithClass("btn btn-success").Close(Localization.SelectFolder);
}
}
}
else
Expand All @@ -43,7 +47,12 @@ public override void WriteInnerContent(TextWriter writer)
new Button(writer).WithCustomAttribute("v-else-if", "export_path === ''").WithClass("btn btn-primary").WithCustomAttribute("disabled").Close(Localization.MenuExport);
new Input(writer).WithCustomAttribute("v-else").WithType("submit").WithClass("btn btn-primary").WithValue(Localization.MenuExport).Close();
}
new Button(writer).WithCustomAttribute("@click", "handleSelectExportFolder").WithClass("btn btn-success").Close(Localization.SelectFolder);

if (Dialogs.Supported)
{
new Button(writer).WithCustomAttribute("@click", "handleSelectExportFolder").WithClass("btn btn-success").Close(Localization.SelectFolder);
}

using (new Div(writer).WithCustomAttribute("v-if", "export_path_has_files").End())
{
new P(writer).Close(Localization.WarningThisDirectoryIsNotEmptyAllContentWillBeDeleted);
Expand Down

0 comments on commit 6231dc0

Please sign in to comment.