Fix ricerca globale

This commit is contained in:
valentina 2024-08-22 10:19:35 +02:00
parent 1fac42854f
commit 5c86d3b748
4 changed files with 13 additions and 13 deletions

View File

@ -50,14 +50,14 @@ $(document).ready(function () {
data = data ? data : []; data = data ? data : [];
// Trasformazione risultati in formato leggibile // Trasformazione risultati in formato leggibile
const results = data.map(function (result) { const results = data.map(result => {
return { const title = result.title;
label: result.badge ? result.badge : '<h4>' + result.title + '</h4>' + result.badges const labels = result.labels.join('').split('<br/>,').join('<br/>');
.join('').split('<br/>,').join('<br/>'), const label = result.label ? result.label : `<h5>${title}</h5><small>${labels}</small>`;
group: result.category, const group = result.category;
link: result.link, const link = result.link;
value: result.title const value = result.title;
} return { label, group, link, value };
}); });
// Rimozione ricerca in corso // Rimozione ricerca in corso
@ -87,8 +87,8 @@ $(document).ready(function () {
}, },
render: function(item, currentValue){ render: function(item, currentValue){
const itemElement = document.createElement("div"); const itemElement = document.createElement("div");
itemElement.innerHTML = item.badge; itemElement.innerHTML = item.label;
// <a href='" + item.link + "' title='Clicca per aprire'><b>" + item.value + "</b><br/>" + item.badge + "</a> // <a href='" + item.link + "' title='Clicca per aprire'><b>" + item.value + "</b><br/>" + item.label + "</a>
return itemElement; return itemElement;
} }
}); });

View File

@ -322,7 +322,7 @@ function impostaCategorieAllegatiDisponibili(gestione, categorie) {
update(results); update(results);
}, },
onSelect: function (item) { onSelect: function (item) {
input.value = item.badge; input.value = item.label;
}, },
}); });
} }

View File

@ -90,7 +90,7 @@ $(document).ready(function () {
update(results); update(results);
}, },
onSelect: function (item) { onSelect: function (item) {
input.value = item.badge; input.value = item.label;
}, },
}); });
}); });

View File

@ -862,7 +862,7 @@ if (empty($record['deleted_at'])) {
update(results); update(results);
}, },
onSelect: function (item) { onSelect: function (item) {
input.value = item.badge; input.value = item.label;
}, },
}); });
} }