fix bug of putting info in wrong table, and scrolling to top (#3042)
This commit is contained in:
parent
23842bf143
commit
83ccc2eced
|
@ -37,8 +37,14 @@ function addRow(table, pin, cid) {
|
||||||
clone.querySelector(".pin-data").dataset.type = pin.type;
|
clone.querySelector(".pin-data").dataset.type = pin.type;
|
||||||
if (pin.pdiv) {
|
if (pin.pdiv) {
|
||||||
row.addEventListener('click', function(table, pin, cid) {
|
row.addEventListener('click', function(table, pin, cid) {
|
||||||
clickPin(table.parentElement.parentElement.parentElement.querySelector(".info-table tbody"), pin, cid);
|
var container;
|
||||||
table.parentElement.parentElement.parentElement.scrollIntoView()
|
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));
|
}.bind(null, table, pin, cid));
|
||||||
}
|
}
|
||||||
table.appendChild(clone);
|
table.appendChild(clone);
|
||||||
|
|
Loading…
Reference in New Issue