datasets now redirect to their details pages.
also implemented 'button' look and feel for the datasets
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user