From 538d56eb32ae34e599846778b14d3c8ed804a757 Mon Sep 17 00:00:00 2001 From: cesare Date: Thu, 9 Mar 2023 17:41:52 +0100 Subject: [PATCH] modificato hover nella lista risultati --- js/cesareBrowse.js | 44 ++++++++++++++++++++++++++++++++++++++++++-- js/utils.js | 4 ++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 502896b..11f5956 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -335,7 +335,7 @@ $(" ."+formaClass).hover(function(idx, element) { } return } - + const start = performance.now(); queryExecuted = false; listarisultati.sort(function(a, b){return a - b}); @@ -416,6 +416,8 @@ $(" ."+formaClass).hover(function(idx, element) { elencoRisutati.append(mhr) } + const endCaricamento = performance.now(); + console.log(`Caricamento contesti time: ${endCaricamento - start} ms`); //evidenzio resultati @@ -423,6 +425,9 @@ $(" ."+formaClass).hover(function(idx, element) { idris = '#e' + ris $(idris).addClass("font-weight-bold mark ") } + + const endEvidRis = performance.now(); + console.log(`Evidenza risultati time: ${endEvidRis - start} ms`); //evidenzio i periodi se unità di ricerca è impostato come periodo if (listaPeriodiRisultato.length){ @@ -444,14 +449,23 @@ $(" ."+formaClass).hover(function(idx, element) { //visualizzo $("#vistaFrasi").attr('style', 'display: d-flex;'); //manageMM("#vistaFrasi") + + const endVis = performance.now(); + console.log(`Visualizzazione time: ${endVis - start} ms`); + drawMinimap('#vistaFrasi') + const enddmm = performance.now(); + console.log(`DrawMM time: ${enddmm - start} ms`); if (selectedVista=='frasi'){ loadFrasi(); } //aggiungo listeners - addFormaListeners() + //addFormaListeners() + addFormaListenersInCanto() + const endal = performance.now(); + console.log(`Addlistener time: ${endal - start} ms`); }); @@ -557,6 +571,32 @@ $(" ."+formaClass).hover(function(idx, element) { } + function addFormaListenersInCanto(){ + + $(cantoDisplayed).find(" ." + formaClass).each(function(idx, element) { + var ele = $(element); + ele.tooltip({ + content: (function() { return formatTTContent(ele.attr('title'), ele.attr('class').split(' ')[1]); }), + classes: { "ui-tooltip": 'Nik_dropdown-content' }, + close: function(event, ui) { $(".ui-helper-hidden-accessible").remove(); }, + create: function(ev, ui) { $(this).data("ui-tooltip").liveRegion.remove(); }, + hide: false, + show: {delay: 800,duration: 0} + + }); + ele.hover(function(idx, element) { + + sentenceId = $(this).attr('class').split(' ')[0].split('_') + var tmplisid = sentenceId[0] + '_' + sentenceId[1] + '_' + sentenceId[3] + lsentid = $(this).attr('class').split(' ')[0] + lisid = tmplisid + + }); + + }); + + } + function getRoman(numero) { diff --git a/js/utils.js b/js/utils.js index e85d1d3..6f09931 100644 --- a/js/utils.js +++ b/js/utils.js @@ -306,12 +306,12 @@ function getFormaContext(formaid, numversi=3) { var pos = 0 var startindex=Math.max(0, (offset-25)) - console.log('Forma id: '+formaid+' startindex '+ startindex+' offset '+offset+' ('+cantica+')') + //console.log('Forma id: '+formaid+' startindex '+ startindex+' offset '+offset+' ('+cantica+')') for (i=startindex; i