Clickable links added to top scorers container on league pages

This commit is contained in:
Lucas Patenaude
2024-04-14 22:36:55 -06:00
parent 993aef8bd9
commit 4593d48df6
3 changed files with 12 additions and 2 deletions

View File

@@ -7,6 +7,16 @@
margin-bottom: 10px; /* Adjust the value as needed */
}
#top-scorers-stats-container tbody tr:hover {
border: 1px solid lightgray;
#club-name-column {
text-decoration: underline;
}
}
#goals-column {
text-align: center;
font-size: 20px;

View File

@@ -1,5 +1,5 @@
// Add click event listener to club logos
document.querySelectorAll('#table-club-logo, #club-name, #top-scorers-logo').forEach(element => {
document.querySelectorAll('#table-club-logo, #club-name, #top-scorers-logo, #club-name-column').forEach(element => {
element.addEventListener('click', (event) => {
// Get the club ID from the clicked club logo's clubID attribute
const clubId = element.getAttribute('clubID');

View File

@@ -76,7 +76,7 @@
<td id="goals-column">{{goals}}</td>
<td><img id="top-scorers-logo" clubID="{{team.team_id}}" src="{{team.team_crest}}" alt="{{table.team_name}} Crest"></img></td>
<td id="player-name-column">{{player.player_name}}</td>
<td id="club-name-column">{{team.team_name}}</td>
<td id="club-name-column" clubID="{{team.team_id}}">{{team.team_name}}</td>
<td>{{games_played}}</td>
</tr>
{{/each}}