Remove search provider dropdown when there's only a single provider

Resolves #1509
This commit is contained in:
Chris Hunt
2025-11-11 12:00:41 +00:00
parent 900fc83e79
commit 130661bd34
6 changed files with 55 additions and 9 deletions

View File

@@ -185,7 +185,10 @@ $.when($.ready).then(() => {
.on("input", "input[name=q]", function () {
const search = this.value;
const items = $("#sortable").find(".item-container");
const provider = $("#search-container select[name=provider]").val();
// Get provider from either select or hidden input
const provider =
$("#search-container select[name=provider]").val() ||
$("#search-container input[name=provider]").val();
if (provider === "tiles") {
hideAutocomplete();

View File

@@ -926,6 +926,12 @@ div.create {
max-width: 620px;
position: relative;
z-index: 4;
// Reduce width when there's no select dropdown (only has hidden input)
&:has(input[name="provider"][type="hidden"]) {
max-width: 520px;
}
form {
width: 100%;
}
@@ -944,6 +950,11 @@ div.create {
width: 100%;
background: transparent;
}
// When there's no select dropdown, round the input's left corners
input[name="q"]:first-child {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
button {
position: absolute;
right: 0px;
@@ -967,6 +978,11 @@ div.create {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
// When select exists, remove input's left border radius
select ~ input[name="q"] {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
#search-autocomplete {