Code refactor
This commit is contained in:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user