view default/static/css.js @ 22:a6ec7f0fa877

default (disconnect): basic message for disconnection page
author Goffi <goffi@goffi.org>
date Sun, 21 May 2017 16:12:47 +0200
parents c319291943be
children 494d740aa3d6
line wrap: on
line source

function set_clicked_class_tag(tag_name, class_name='clicked') {
    for (let elt of document.getElementsByTagName(tag_name)) {
        elt.classList.toggle(class_name);
    }
}

function set_clicked_class_id(trigger_elem_id, target_elem_id=null, class_name='clicked') {
    if (target_elem_id === null) { target_elem_id = trigger_elem_id; }
    document.getElementById(trigger_elem_id).addEventListener(
        "click",
        function() {
            document.getElementById(target_elem_id).classList.toggle(class_name);
        }
    );
}