From fb3e8008ad2cef79c150f886cf242323ae764136 Mon Sep 17 00:00:00 2001 From: cesare Date: Tue, 11 Apr 2023 11:00:35 +0200 Subject: [PATCH] grafi sintattici rimossi quando si cambia vista --- js/cesareBrowse.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index d0d1759..a4cf899 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -70,6 +70,17 @@ $("#valoreVista").on('change', function() { $(cantoDisplayed).attr('style', 'display: d-flex;') break; case "frasi": + //cancello il grafo sintattico + var periodograph=document.getElementById("periodograph"); + if (periodograph!=null){ + let showngr=periodograph.getAttribute('name').split("_") + var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2]; + resetSentenceStructure(tmpsent) + shownSentenceList.delete(tmpsent) + + //$("#periodograph").empty() + periodograph.parentNode.removeChild(periodograph); + } loadFrasi(); break; @@ -663,6 +674,18 @@ function resetFrasi(){ } } + //cancello il grafo sintattico + var periodograph=document.getElementById("periodograph"); + if (periodograph!=null){ + let showngr=periodograph.getAttribute('name').split("_") + var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2]; + + resetSentenceStructure(tmpsent) + shownSentenceList.delete(tmpsent) + + //$("#periodograph").empty() + periodograph.parentNode.removeChild(periodograph); + } } function getCantica(numeroCantica){