Skip to content

Commit

Permalink
Fix ricerca globale
Browse files Browse the repository at this point in the history
  • Loading branch information
Pek5892 committed Aug 22, 2024
1 parent 1fac428 commit 5c86d3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions assets/src/js/base/supersearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '<h4>' + result.title + '</h4>' + result.badges
.join('').split('<br/>,').join('<br/>'),
group: result.category,
link: result.link,
value: result.title
}
const results = data.map(result => {
const title = result.title;
const labels = result.labels.join('').split('<br/>,').join('<br/>');
const label = result.label ? result.label : `<h5>${title}</h5><small>${labels}</small>`;
const group = result.category;
const link = result.link;
const value = result.title;
return { label, group, link, value };
});

// Rimozione ricerca in corso
Expand Down Expand Up @@ -87,8 +87,8 @@ $(document).ready(function () {
},
render: function(item, currentValue){
const itemElement = document.createElement("div");
itemElement.innerHTML = item.badge;
// <a href='" + item.link + "' title='Clicca per aprire'><b>" + item.value + "</b><br/>" + item.badge + "</a>
itemElement.innerHTML = item.label;
// <a href='" + item.link + "' title='Clicca per aprire'><b>" + item.value + "</b><br/>" + item.label + "</a>
return itemElement;
}
});
Expand Down
2 changes: 1 addition & 1 deletion assets/src/js/functions/allegati.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ function impostaCategorieAllegatiDisponibili(gestione, categorie) {
update(results);
},
onSelect: function (item) {
input.value = item.badge;
input.value = item.label;
},
});
}
2 changes: 1 addition & 1 deletion include/modifica_allegato.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
update(results);
},
onSelect: function (item) {
input.value = item.badge;
input.value = item.label;
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion modules/anagrafiche/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ function risolviConto(tipo){
update(results);
},
onSelect: function (item) {
input.value = item.badge;
input.value = item.label;
},
});
}
Expand Down

0 comments on commit 5c86d3b

Please sign in to comment.