diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index dd5e21e..6927762 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -1015,6 +1015,13 @@ function resetFrasi(){ } return false; } + function numberOfComments(cid){ + + var id = cid.substr(9); + //[....].filter(x => x==2).length + return commentsArray.filter(x => x.verso==id).length + + } /*FINE GESTIONE CITAZIONI*/ function getCantica(numeroCantica){ @@ -1225,8 +1232,10 @@ function resetFrasi(){ var verso = parseInt(formaItem[3]) - 1; var idCommento = "Commento_"+idcantica+"_"+canto+"_"+verso; - if (hasComments(idCommento)){ + //if (hasComments(idCommento)){ + if (numberOfComments(idCommento)>0){ createCommentSpan(idCommento, elverso) + console.log("Numero commenti: "+numberOfComments(idCommento)) } if(currSentenceId!=null && currSentenceId != sentenceid){