Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use click handlers instead of inserting anchor tags in .table-seamless-links #2117

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions evap/evaluation/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,9 @@

// activate clickable hover tables
document.querySelectorAll(".table-seamless-links [data-url]").forEach(row => {
for(const table_data of row.children) {
const wrapping_anchor = document.createElement("a");
wrapping_anchor.href = row.dataset["url"];
wrapping_anchor.append(...table_data.childNodes);
table_data.replaceChildren(wrapping_anchor);
}
row.addEventListener("click", () => {
window.location.assign(row.dataset.url);
});
});

document.querySelectorAll(".hover-row").forEach(row => {
Expand Down
11 changes: 0 additions & 11 deletions evap/static/scss/components/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,8 @@ $table-colors: (
padding-bottom: 0.4rem;
}

// Seamless links in tables
//
// -1- Expand links to fill the cell
.table-seamless-links td {
overflow: hidden;

a:not(.btn) {
color: $black;
text-decoration: none;
richardebeling marked this conversation as resolved.
Show resolved Hide resolved
display: block; // -1-
margin: -10em; // -1-
padding: 10em; // -1-
}
}

// Hoverable rows
Expand Down
Loading