Code refactor

This commit is contained in:
2025-06-07 10:12:47 +02:00
parent c85b918f71
commit 1e5cd0790b
10 changed files with 38 additions and 19 deletions
+2 -2
View File
@@ -4,8 +4,6 @@ const download = document.getElementById("download");
const logout = document.getElementById("logout");
const add = document.getElementById("add");
const sql_rows = sql_table.rows;
function setEventListeners(element, cb) {
element.onmouseenter = async function () {
this.style.backgroundColor = "blue";
@@ -56,6 +54,8 @@ setEventListeners(logout, () => {
window.location.href = `${window.location.protocol}//logout@${window.location.host}/`;
});
const sql_rows = sql_table.rows;
for (let i = 1; i < sql_rows.length; i++) {
setEventListeners(sql_rows[i], () => {
window.location.href = `/app/edit?element=${sql_rows[i].cells[0].innerText}`;