Fix pinout table (#2550)
* fix clicking on row * fix display and scroll to top
This commit is contained in:
parent
271e90e7dc
commit
1ca6d22af4
|
@ -17,13 +17,15 @@ function addRow(table, pin, pdiv) {
|
|||
tdata.textContent = pin.type
|
||||
fdata.textContent = pin.function;
|
||||
cdata.textContent = pin.color
|
||||
row.addEventListener('click', function(pin, pdiv) {
|
||||
clickPin(pin, pdiv);
|
||||
}.bind(null, pin, pdiv));
|
||||
row.addEventListener('click', function(table, pin, pdiv) {
|
||||
clickPin(table.parentElement.parentElement.parentElement.querySelector(".info-table tbody"), pin, pdiv);
|
||||
table.parentElement.parentElement.parentElement.scrollIntoView()
|
||||
}.bind(null, table, pin, pdiv));
|
||||
table.appendChild(clone);
|
||||
}
|
||||
|
||||
function clickPin(table, pin, pdiv) {
|
||||
table.parentElement.style.display = "table";
|
||||
table.innerHTML = "";
|
||||
addRow(table, pin, pdiv);
|
||||
var pins = document.querySelectorAll(".pin-marker");
|
||||
|
|
|
@ -183,6 +183,10 @@ table th {
|
|||
color: black;
|
||||
}
|
||||
|
||||
.info-table {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
background-color: black;
|
||||
|
|
Loading…
Reference in New Issue