From 85868d499767c2a052c79ca150972c7076011459 Mon Sep 17 00:00:00 2001 From: Luca Trupiano Date: Wed, 13 Dec 2023 13:57:05 +0100 Subject: [PATCH] Creazione dei collapse calcolata sui dati e dimensioni attuali --- index_4.4.html | 13 ++++++++----- js/cesareBrowse.js | 32 ++++++++++++-------------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/index_4.4.html b/index_4.4.html index aef0728..5ee7cec 100644 --- a/index_4.4.html +++ b/index_4.4.html @@ -11,11 +11,11 @@ - - - - - + + + + + @@ -484,6 +484,9 @@ Nessun commento visualizzato +
+ +
diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index afd753f..8d19aca 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -944,7 +944,7 @@ function resetFrasi(){ } function createModule(collapse,label, testo, num, id, pos){ - //console.log(label+": "+testo.length); + var minLength = ($('#displaynote').width() / $('#Test').width() * 2 * 32); var divContent = $('
'); //var divContent = $('
'); //var divTesto = $('
') @@ -952,23 +952,19 @@ function resetFrasi(){ //divTesto.append(nota); //divContent.append(divTesto); divContent.append(nota); - if (testo.length > 210) { -/* -var a = $('#displaynote').width(); -var b = $('#Test').width(); -var c = (a / b * 2.2 * 52) -console.log($('#Test').text().length) -console.log(c) -*/ + if ((testo.length + label.length +2) > minLength) { + //console.log((testo.length + label.length +2) +" "+($('#displaynote').width() / $('#Test').width() * 2 * 32)) var divModule = $('
'); var divNote = $('