target blank for link

This commit is contained in:
Burak Civan
2022-10-13 17:09:09 +03:00
parent 7e85cff8a6
commit a99cb13121
2 changed files with 14 additions and 6 deletions

View File

@ -30,6 +30,14 @@ document.querySelectorAll("[data-table-body]").forEach((table) => {
td_item.addEventListener("click", () => {
window.location.href = row_href;
});
// added target blank for click mouse middle button
td_item.addEventListener('mousedown', (event) => {
if (event.button == 1 || event.buttons == 4) {
window.open(row_href, "_blank");
}
});
// added target blank for click mouse middle button
}
}
});