Ordinato risultato ricerca riferimenti
This commit is contained in:
parent
b937d25ca3
commit
dc93993858
|
@ -232,7 +232,32 @@ export async function queryRiferimenti(filtro, cid) {
|
|||
|
||||
await tconn.close();
|
||||
var resxcantica = Object.groupBy(result4, ({ Cantica }) => Cantica);
|
||||
|
||||
var resKeys = Object.keys(resxcantica);
|
||||
|
||||
for (let key = 0; key < resKeys.length; key++) {
|
||||
|
||||
switch(resKeys[key]){
|
||||
case "Inferno": resxcantica.Inferno.sort(function(a, b) {
|
||||
var valA = a.Verso.split('-')[0]
|
||||
var valB = b.Verso.split('-')[0]
|
||||
return a.Canto.localeCompare(b.Canto) || Number(valA) - Number(valB);
|
||||
});
|
||||
break;
|
||||
case "Purgatorio": resxcantica.Purgatorio.sort(function(a, b) {
|
||||
var valA = a.Verso.split('-')[0]
|
||||
var valB = b.Verso.split('-')[0]
|
||||
return a.Canto.localeCompare(b.Canto) || Number(valA) - Number(valB);
|
||||
});
|
||||
break;
|
||||
case "Paradiso": resxcantica.Paradiso.sort(function(a, b) {
|
||||
var valA = a.Verso.split('-')[0]
|
||||
var valB = b.Verso.split('-')[0]
|
||||
return a.Canto.localeCompare(b.Canto) || Number(valA) - Number(valB);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
listaidversi = []
|
||||
var numcid = cid.split('_')[1]
|
||||
for (var cantica in resxcantica) {
|
||||
|
@ -252,6 +277,7 @@ export async function queryRiferimenti(filtro, cid) {
|
|||
|
||||
var tmp = resxcantica[cantica]
|
||||
var resxcanto = Object.groupBy(tmp, ({ Canto }) => Canto);
|
||||
|
||||
for (var canto in resxcanto) {
|
||||
var tmpv = resxcanto[canto]
|
||||
var spanbadge = $('<span />');
|
||||
|
|
Loading…
Reference in New Issue