From 1054780b425330f854a2cb8e9c035f1c95f618c9 Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 10 Mar 2023 09:49:33 +0100 Subject: [PATCH] nella lista risultati hover solo sulle forme risultato --- js/cesareBrowse.js | 65 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 11f5956..8d82a83 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -245,7 +245,9 @@ $(" ."+formaClass).hover(function(idx, element) { } //aggiungo listeners - addFormaListeners() + //addFormaListeners() + //addFormaListenersInCanto() + addFormaListenersInRisultato() //disegno minimap drawMinimap('#vistaFrasi') @@ -455,18 +457,21 @@ $(" ."+formaClass).hover(function(idx, element) { drawMinimap('#vistaFrasi') - const enddmm = performance.now(); - console.log(`DrawMM time: ${enddmm - start} ms`); + if (selectedVista=='frasi'){ loadFrasi(); } //aggiungo listeners //addFormaListeners() - addFormaListenersInCanto() + //addFormaListenersInCanto() + addFormaListenersInRisultato() const endal = performance.now(); console.log(`Addlistener time: ${endal - start} ms`); + const enddmm = performance.now(); + console.log(`DrawMM time: ${enddmm - start} ms`); + }); @@ -520,7 +525,8 @@ $(" ."+formaClass).hover(function(idx, element) { loadFrasi(); } - addFormaListeners(); + //addFormaListeners(); + addFormaListenersInCanto(); }); @@ -571,20 +577,25 @@ $(" ."+formaClass).hover(function(idx, element) { } - function addFormaListenersInCanto(){ + function addFormaListenersInRisultato(){ - $(cantoDisplayed).find(" ." + formaClass).each(function(idx, element) { - var ele = $(element); - ele.tooltip({ + for (ris of listarisultati) { + + idris = '#e' + ris + ele=$(idris) + $(idris).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(); }, + //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) { + + } + $(cantoDisplayed).find(" ." + formaClass).each(function(idx, element) { + $(element).hover(function(idx, element) { sentenceId = $(this).attr('class').split(' ')[0].split('_') var tmplisid = sentenceId[0] + '_' + sentenceId[1] + '_' + sentenceId[3] @@ -594,6 +605,36 @@ $(" ."+formaClass).hover(function(idx, element) { }); }); + + + } + + function addFormaListenersInCanto(){ + let idn=0 + $(cantoDisplayed).find(" ." + formaClass).each(function(idx, element) { + idn=idn+1 + var ele = $(element); + + $(element).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} + + }); + $(element).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 + + }); + + }); + console.log('nr forme '+idn) }