Index: openacs-4/packages/acs-templating/tcl/head-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/head-procs.tcl,v diff -u -r1.45.2.16 -r1.45.2.17 --- openacs-4/packages/acs-templating/tcl/head-procs.tcl 28 Feb 2020 13:59:24 -0000 1.45.2.16 +++ openacs-4/packages/acs-templating/tcl/head-procs.tcl 31 Mar 2020 19:27:24 -0000 1.45.2.17 @@ -1083,6 +1083,22 @@ } } +ad_proc template::hide { + -class:required +} { + Hide certain CSS classes in the dom-tree by setting for elements + of the specified class the property "display" to "none". + + @param class CSS class to be hidden +} { + template::add_script -section body -script [subst -nocommands { + window.addEventListener('DOMContentLoaded', (event) => { + var els = document.getElementsByClassName("$class"); + for(var i = 0; i < els.length; i++) { els[i].style.display = "none"; } + }); + }] +} + ad_proc template::add_event_listener { {-event click} {-CSSclass "acs-listen"}