rework search-result-window

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-09-08 15:05:19 +02:00
parent 5f2f3bee0a
commit 2e8e09cb2c
3 changed files with 7 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ $(function() {
}
// Show notification for short search query
if (query.length && query.length < 3) {
dropdown.html('<li class="list-group-item text-muted">Please enter more than 2 characters</li>');
dropdown.html('<li class="list-group-item text-muted py-1">Please enter more than 2 characters</li>');
dropdown.parent().show();
return;
}
@@ -31,7 +31,7 @@ $(function() {
success: data => {
// Show notification if we got no results
if (Object.keys(data).length === 0) {
dropdown.html('<li class="list-group-item text-muted">Nothing found!</li>');
dropdown.html('<li class="list-group-item text-muted py-1">Nothing found!</li>');
dropdown.parent().show();
return;
}
@@ -40,15 +40,15 @@ $(function() {
dropdown.html('');
dropdown.parent().show();
Object.keys(data).forEach(key => {
dropdown.append('<li class="list-group-item text-muted text-capitalize">' + key + '</li>');
dropdown.append('<li class="list-group-item text-muted text-capitalize fw-bold py-1 border-bottom">' + key + '</li>');
data[key].forEach(item => {
dropdown.append('<li class="list-group-item"><a href="' + item.href + '" class="text-decoration-none">' + item.title + '</a></li>');
dropdown.append('<li class="list-group-item mt-1"><a href="' + item.href + '" class="text-decoration-none">' + item.title + '</a></li>');
});
});
},
error: function (a, b) {
console.log(a, b);
dropdown.html('<li class="list-group-item text-muted">Whoops we got some errors!</li>');
dropdown.html('<li class="list-group-item text-muted py-1">Whoops we got some errors!</li>');
dropdown.parent().show();
}
});

View File

@@ -24,7 +24,7 @@
.search-results {
width: 100%; /** same as .search-results-box **/
max-height: calc(50vh - 2px); /** same as .search-results-box - border (top/bottom) **/
max-height: calc(50vh - 1.25em); /** same as .search-results-box - border (top/bottom) **/
overflow: auto;
border-radius: $border-radius;
}

View File

@@ -36,7 +36,7 @@
<i class="fa-solid fa-search text-muted"></i>
<input title="search" type="search" class="search-input" placeholder="{{ lng('panel.search') }}...">
</div>
<div class="search-results-box" style="display:none;">
<div class="search-results-box p-2 shadow" style="display:none;">
<div class="search-results list-group-flush"></div>
</div>
</form>