Add config option to hide autocomplete UI options

Implements #57
This commit is contained in:
Dominik Reh
2022-11-01 13:50:34 +01:00
parent 61a97175a7
commit f8a9223c29
2 changed files with 3 additions and 2 deletions

View File

@@ -736,8 +736,9 @@ onUiUpdate(async function () {
}
});
acAppendComma = acConfig.appendComma;
// Add our custom options elements
if (gradioApp().querySelector("#tagAutocompleteOptions") === null) {
if (!acConfig.hideUIOptions && gradioApp().querySelector("#tagAutocompleteOptions") === null) {
let optionsDiv = document.createElement("div");
optionsDiv.id = "tagAutocompleteOptions";
optionsDiv.classList.add("flex", "flex-col", "p-1", "px-1", "relative", "text-sm");
@@ -758,7 +759,6 @@ onUiUpdate(async function () {
});
// Add comma switch
let cbComma = createCheckbox("Append commas");
acAppendComma = acConfig.appendComma;
cbComma.querySelector("input").checked = acAppendComma;
cbComma.querySelector("input").addEventListener("change", (e) => {
acAppendComma = e.target.checked;