diff --git a/assets/src/js/base/supersearch.js b/assets/src/js/base/supersearch.js index eac309c47..5d79dd54e 100644 --- a/assets/src/js/base/supersearch.js +++ b/assets/src/js/base/supersearch.js @@ -50,14 +50,14 @@ $(document).ready(function () { data = data ? data : []; // Trasformazione risultati in formato leggibile - const results = data.map(function (result) { - return { - label: result.badge ? result.badge : '

' + result.title + '

' + result.badges - .join('').split('
,').join('
'), - group: result.category, - link: result.link, - value: result.title - } + const results = data.map(result => { + const title = result.title; + const labels = result.labels.join('').split('
,').join('
'); + const label = result.label ? result.label : `
${title}
${labels}`; + const group = result.category; + const link = result.link; + const value = result.title; + return { label, group, link, value }; }); // Rimozione ricerca in corso @@ -87,8 +87,8 @@ $(document).ready(function () { }, render: function(item, currentValue){ const itemElement = document.createElement("div"); - itemElement.innerHTML = item.badge; - // " + item.value + "
" + item.badge + "
+ itemElement.innerHTML = item.label; + // " + item.value + "
" + item.label + "
return itemElement; } }); diff --git a/assets/src/js/functions/allegati.js b/assets/src/js/functions/allegati.js index c7849f622..25616ab0c 100644 --- a/assets/src/js/functions/allegati.js +++ b/assets/src/js/functions/allegati.js @@ -322,7 +322,7 @@ function impostaCategorieAllegatiDisponibili(gestione, categorie) { update(results); }, onSelect: function (item) { - input.value = item.badge; + input.value = item.label; }, }); } diff --git a/include/modifica_allegato.php b/include/modifica_allegato.php index a314edabb..657a09b0f 100644 --- a/include/modifica_allegato.php +++ b/include/modifica_allegato.php @@ -90,7 +90,7 @@ $(document).ready(function () { update(results); }, onSelect: function (item) { - input.value = item.badge; + input.value = item.label; }, }); }); diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index 562d016c0..9e3d44a4a 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -862,7 +862,7 @@ if (empty($record['deleted_at'])) { update(results); }, onSelect: function (item) { - input.value = item.badge; + input.value = item.label; }, }); }