diff --git a/src/gui/css/accordianStyleSheet.tw b/src/gui/css/accordianStyleSheet.tw index a66921016a7f5855805b990f2e3ad6a8eb5452c2..324a23835182d4e6cd2f75718e5ab032e74cfca3 100644 --- a/src/gui/css/accordianStyleSheet.tw +++ b/src/gui/css/accordianStyleSheet.tw @@ -71,3 +71,14 @@ button.accordion.active:before { max-height: 0; overflow: hidden; } + +div.accordion:before { + content: '\002B'; + color: #777; + font-weight: bold; + float: left; + margin-right: 5px; +} +div.accordion.active:before { + content: "\2212"; +} diff --git a/src/js/accordianJS.js b/src/js/accordianJS.js index 622a41c09b24c0bf0150731990e481fe3e3c1ff8..0b31fa239c32914f8732ba6e51f7a1dd030f661c 100644 --- a/src/js/accordianJS.js +++ b/src/js/accordianJS.js @@ -30,10 +30,19 @@ postdisplay["doAccordion"] = function (content) { acc[i].onclick = function () { this.classList.toggle("active"); var panel = this.nextElementSibling; - if (panel.style.maxHeight) { - panel.style.maxHeight = null; - } else { - panel.style.maxHeight = 2 * panel.scrollHeight + "px"; + if(panel == null || panel == undefined){ + panel = document.getElementById(this.id + "accHidden"); + if( panel.style.display=='none' ){ + panel.style.display = ''; + }else{ + panel.style.display = 'none'; + } + }else{ + if (panel.style.maxHeight) { + panel.style.maxHeight = null; + } else { + panel.style.maxHeight = 2 * panel.scrollHeight + "px"; + } } }; }