nella lista risultati hover solo sulle forme risultato

This commit is contained in:
cesare 2023-03-10 09:49:33 +01:00
parent 538d56eb32
commit 1054780b42
1 changed files with 53 additions and 12 deletions

View File

@ -245,7 +245,9 @@ $(" ."+formaClass).hover(function(idx, element) {
} }
//aggiungo listeners //aggiungo listeners
addFormaListeners() //addFormaListeners()
//addFormaListenersInCanto()
addFormaListenersInRisultato()
//disegno minimap //disegno minimap
drawMinimap('#vistaFrasi') drawMinimap('#vistaFrasi')
@ -455,18 +457,21 @@ $(" ."+formaClass).hover(function(idx, element) {
drawMinimap('#vistaFrasi') drawMinimap('#vistaFrasi')
const enddmm = performance.now();
console.log(`DrawMM time: ${enddmm - start} ms`);
if (selectedVista=='frasi'){ if (selectedVista=='frasi'){
loadFrasi(); loadFrasi();
} }
//aggiungo listeners //aggiungo listeners
//addFormaListeners() //addFormaListeners()
addFormaListenersInCanto() //addFormaListenersInCanto()
addFormaListenersInRisultato()
const endal = performance.now(); const endal = performance.now();
console.log(`Addlistener time: ${endal - start} ms`); 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(); loadFrasi();
} }
addFormaListeners(); //addFormaListeners();
addFormaListenersInCanto();
}); });
@ -571,20 +577,25 @@ $(" ."+formaClass).hover(function(idx, element) {
} }
function addFormaListenersInCanto(){ function addFormaListenersInRisultato(){
$(cantoDisplayed).find(" ." + formaClass).each(function(idx, element) { for (ris of listarisultati) {
var ele = $(element);
ele.tooltip({ idris = '#e' + ris
ele=$(idris)
$(idris).tooltip({
content: (function() { return formatTTContent(ele.attr('title'), ele.attr('class').split(' ')[1]); }), content: (function() { return formatTTContent(ele.attr('title'), ele.attr('class').split(' ')[1]); }),
classes: { "ui-tooltip": 'Nik_dropdown-content' }, classes: { "ui-tooltip": 'Nik_dropdown-content' },
close: function(event, ui) { $(".ui-helper-hidden-accessible").remove(); }, //close: function(event, ui) { $(".ui-helper-hidden-accessible").remove(); },
create: function(ev, ui) { $(this).data("ui-tooltip").liveRegion.remove(); }, //create: function(ev, ui) { $(this).data("ui-tooltip").liveRegion.remove(); },
hide: false, hide: false,
show: {delay: 800,duration: 0} 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('_') sentenceId = $(this).attr('class').split(' ')[0].split('_')
var tmplisid = sentenceId[0] + '_' + sentenceId[1] + '_' + sentenceId[3] 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)
} }