From 1eebd40af669b6341607120d22ee5027535d95a9 Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 7 Feb 2025 13:27:48 +0100 Subject: [PATCH] bug fixing --- js/browseMgr_5.0.js | 7 ++++--- js/script_5.0.js | 2 +- js/utilsMgr_5.0.js | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/js/browseMgr_5.0.js b/js/browseMgr_5.0.js index eb8ddde..c14c698 100644 --- a/js/browseMgr_5.0.js +++ b/js/browseMgr_5.0.js @@ -359,9 +359,10 @@ $(document).ready(function() { return (res) } if (listaClausoleRisultatoContesti.length && !listarisultati.length ) { - - - for (let i=startcont; i<=endcont; i++){ + var lim=endcont + if (listaClausoleRisultatoContesti.length<=endcont) + lim=listaClausoleRisultatoContesti.length-1 + for (let i=startcont; i<=lim; i++){ res.push(listaClausoleRisultatoContesti[i]) } //res.sort(function(a, b) { puno = a[0].split('-')[3]; pdue = b[0].split('-')[3]; return parseInt(puno) - parseInt(pdue) }); diff --git a/js/script_5.0.js b/js/script_5.0.js index f474fe1..668f3d5 100644 --- a/js/script_5.0.js +++ b/js/script_5.0.js @@ -713,7 +713,7 @@ $(document).ready(function() { window.context100 = JSON.parse(JSON.stringify(contextEmpty)); const jsonReplacer = (key, value) => typeof value === 'undefined' ? 0 : value; - var nRisultatiPerPag = showOffset; + var nRisultatiPerPag = 30;//showOffset; // Fine variabili diff --git a/js/utilsMgr_5.0.js b/js/utilsMgr_5.0.js index 047ec1f..9cccebb 100644 --- a/js/utilsMgr_5.0.js +++ b/js/utilsMgr_5.0.js @@ -122,15 +122,18 @@ function getFraseContext(fraseids, numversi = 3) { } maxpos = listaforme.length - 1 var pos = 0 - var startindex = Math.max(0, (offset - 20)) + var startindex = Math.max(0, (offset - 30)) for (i = startindex; i < listaforme.length; i++) { var tmpos = listaforme[i].split('_')[2] + if (parseInt(tmpos) == parseInt(fraseid.split('-')[2])) { pos = i; break; } } + console.log (fraseid +" - " + parseInt(fraseid.split('-')[2])+ ' - '+pos) + var pos2 = pos if (fraseids.length > 1)