Skip to content

Commit

Permalink
go to journal button
Browse files Browse the repository at this point in the history
  • Loading branch information
cheryllium committed Jan 5, 2024
1 parent f5440b3 commit 6239d8c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ export default class UIManager {
fishInfo.innerHTML = `<b>Name: </b><span style='color: ${fish.favoriteColor}'>${fish.name}</span>`;
fishInfo.innerHTML += `<br><b>Mood: </b>${fish.mood}`;
fishInfo.innerHTML += `<br /><b>Favorite food: </b>${fish.favoriteFood}`;

fishInfo.innerHTML += "<br />";

let fishLink = document.createElement("a");
fishLink.href = "#journal";
fishLink.innerText = "Go to journal";
fishLink.addEventListener("click", function () {
this.setJournalSelected(fish);
}.bind(this));

fishDiv.appendChild(fishImage);
fishDiv.appendChild(fishInfo);
fishDiv.appendChild(fishLink);

// Add it to the selected fish div
selectedFishDiv.appendChild(fishDiv);
Expand Down

0 comments on commit 6239d8c

Please sign in to comment.