From f8a9223c29b412bf59fe1e2e620462022f5618ac Mon Sep 17 00:00:00 2001 From: Dominik Reh Date: Tue, 1 Nov 2022 13:50:34 +0100 Subject: [PATCH] Add config option to hide autocomplete UI options Implements #57 --- javascript/tagAutocomplete.js | 4 ++-- tags/config.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/javascript/tagAutocomplete.js b/javascript/tagAutocomplete.js index 9b16bea..1a961f8 100644 --- a/javascript/tagAutocomplete.js +++ b/javascript/tagAutocomplete.js @@ -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; diff --git a/tags/config.json b/tags/config.json index 1cb47d8..e2834ac 100644 --- a/tags/config.json +++ b/tags/config.json @@ -5,6 +5,7 @@ "img2img": true, "negativePrompts": true }, + "hideUIOptions": false, "maxResults": 5, "resultStepLength": 500, "delayTime": 100,