mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 00:40:30 -05:00
28 lines
714 B
JavaScript
28 lines
714 B
JavaScript
|
(function() {
|
||
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||
|
const rows = document.querySelectorAll(".rpc-row-info");
|
||
|
|
||
|
const onRowClick = (event) => {
|
||
|
const target = event.currentTarget;
|
||
|
for (let node of rows) {
|
||
|
if (node !== target) {
|
||
|
node.nextElementSibling.classList.add("hidden");
|
||
|
} else {
|
||
|
const sibling = target.nextElementSibling;
|
||
|
|
||
|
if (sibling.classList.contains("hidden")) {
|
||
|
sibling.classList.remove("hidden");
|
||
|
} else {
|
||
|
sibling.classList.add("hidden");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
for (let node of rows) {
|
||
|
node.addEventListener("click", onRowClick);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
})();
|