2021-08-20 09:47:53 +02:00
|
|
|
(function(){
|
|
|
|
function log_show_details(elm) {
|
|
|
|
const id = elm.id;
|
|
|
|
var hidden = true;
|
|
|
|
document
|
|
|
|
.querySelectorAll('[data-id="' + id + '"]')
|
|
|
|
.forEach(edetails => {
|
|
|
|
hidden = edetails.classList.toggle('hidden');
|
|
|
|
});
|
|
|
|
document
|
|
|
|
.querySelectorAll('[aria-expanded="true"]')
|
|
|
|
.forEach(eexpanded => {
|
|
|
|
eexpanded.setAttribute('aria-expanded', false);
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!hidden) {
|
|
|
|
elm.setAttribute('aria-expanded', true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-27 18:28:09 +01:00
|
|
|
document
|
2021-08-20 09:47:53 +02:00
|
|
|
.querySelectorAll('.log-event')
|
2021-03-27 18:28:09 +01:00
|
|
|
.forEach(elm => {
|
2021-08-20 09:47:53 +02:00
|
|
|
elm.addEventListener("click", evt => {
|
|
|
|
log_show_details(evt.currentTarget);
|
|
|
|
});
|
|
|
|
elm.addEventListener("keydown", evt => {
|
|
|
|
if (evt.keyCode == 13 || evt.keyCode == 32) {
|
|
|
|
log_show_details(evt.currentTarget);
|
|
|
|
}
|
|
|
|
});
|
2021-03-27 18:28:09 +01:00
|
|
|
});
|
2021-08-20 09:47:53 +02:00
|
|
|
})();
|