More pinout fixes (#2751)

* try to fix off-by-one

* try new font size
This commit is contained in:
David Holdeman 2021-05-29 00:05:10 -05:00 committed by GitHub
parent dd14cb277a
commit f2fdea33fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -17,10 +17,12 @@ function addRow(table, pin, pdiv) {
tdata.textContent = pin.type
fdata.textContent = pin.function;
cdata.textContent = pin.color
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));
if (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);
}
@ -67,8 +69,10 @@ window.addEventListener('load', function() {
break;
}
}
addRow(fullTable, connector.pins[i], pdiv);
if (!pinfo.x) continue;
if (!pinfo.x) {
addRow(fullTable, connector.pins[i], null);
continue;
}
var closest = 1000000;
for (var ii = 0; ii < connector.info.pins.length; ii++) {
var tinfo = connector.info.pins[ii];
@ -101,8 +105,9 @@ window.addEventListener('load', function() {
pdiv.style.width = width + "%";
pdiv.style.marginTop = "-" + (width / 2) + "%";
pdiv.style.marginLeft = "-" + (width / 2) + "%";
pdiv.style.fontSize = (height / 7.5) + "vw";
pdiv.style.fontSize = (height * 1.8) + "px";
cdiv.appendChild(pdiv);
addRow(fullTable, connector.pins[i], pdiv);
}
}.bind(null, connector, sdiv, img));
img.src = connector.info.image.file;