From 5c86d3b7489431b2e8001841b07769cd26e4c24c Mon Sep 17 00:00:00 2001 From: valentina Date: Thu, 22 Aug 2024 10:19:35 +0200 Subject: [PATCH] Fix ricerca globale --- assets/src/js/base/supersearch.js | 20 ++++++++++---------- assets/src/js/functions/allegati.js | 2 +- include/modifica_allegato.php | 2 +- modules/anagrafiche/edit.php | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) 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; }, }); }