fix bug of putting info in wrong table, and scrolling to top (#3042)

This commit is contained in:
David Holdeman 2021-07-23 16:05:43 -05:00 committed by GitHub
parent 23842bf143
commit 83ccc2eced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -37,8 +37,14 @@ function addRow(table, pin, cid) {
clone.querySelector(".pin-data").dataset.type = pin.type;
if (pin.pdiv) {
row.addEventListener('click', function(table, pin, cid) {
clickPin(table.parentElement.parentElement.parentElement.querySelector(".info-table tbody"), pin, cid);
table.parentElement.parentElement.parentElement.scrollIntoView()
var container;
for (var elem = table; elem && elem !== document; elem = elem.parentNode) {
if (elem.matches(".container")) {
var container = elem;
};
}
clickPin(container.querySelector(".info-table tbody"), pin, cid);
container.scrollIntoView()
}.bind(null, table, pin, cid));
}
table.appendChild(clone);