datasets now redirect to their details pages.

also implemented 'button' look and feel for the datasets
This commit is contained in:
J-Klinke 2024-07-06 13:31:30 +02:00
parent cd1e4c6b26
commit 464cf104f9
2 changed files with 14 additions and 1 deletions

View File

@ -104,7 +104,15 @@ export default class Dataset {
return null;
}
clone.querySelector(".dataset").dataset.id = this.#id;
let datasetContainer = clone.querySelector(".dataset");
datasetContainer.dataset.id = this.#id;
datasetContainer.addEventListener("click", event => {
if (!event.target.classList.contains("btn")) {
let detailsPage = new URL("/details.html", location.origin);
detailsPage.searchParams.append("id", this.#id);
window.location.href = detailsPage.toString();
}
})
clone.querySelector(".dataset-title").innerText = this.#title;
clone.querySelector(".dataset-description").innerText = this.#description;
clone.querySelector(".upvote-count").innerText = this.#upvotes;

View File

@ -109,6 +109,11 @@ header {
align-items: center;
justify-content: space-between;
box-sizing: border-box;
cursor: pointer;
}
.dataset:hover {
filter: brightness(1.2);
}
.upvote {