Skip to content

Commit 9f44e13

Browse files
committed
Lazy load team pictures
On the public scoreboard page, all team pictures are loaded on page load. Similar to the affiliation logos, these should be lazy-loaded on-demand. Also change from `id` to `class`, as there should not be multiple elements with the same `id` on a page.
1 parent f4095e6 commit 9f44e13

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

webapp/public/style_domjudge.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ tr.ignore td, td.ignore, span.ignore {
400400
margin-right: auto;
401401
}
402402

403-
#teampicture {
403+
.teampicture {
404404
width: 100%;
405405
border: 1px solid black;
406406
}

webapp/templates/jury/team.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
{% set teamImage = teamId | assetPath('team') %}
183183
{% if teamImage %}
184184
<div class="col">
185-
<img id="teampicture" src="{{ asset(teamImage) }}" alt="Picture of team {{ team.name }}"
185+
<img loading="lazy" class="teampicture" src="{{ asset(teamImage) }}" alt="Picture of team {{ team.name }}"
186186
title="Picture of team {{ team.effectiveName }}">
187187
</div>
188188
{% endif %}

webapp/templates/partials/team.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
{% set teamImage = teamId | assetPath('team') %}
6161
{% if teamImage %}
6262
<div class="col-lg-{{ size | default(4) }}">
63-
<img id="teampicture" src="{{ asset(teamImage) }}" alt="Picture of team {{ team.effectiveName }}"
63+
<img loading="lazy" class="teampicture" src="{{ asset(teamImage) }}" alt="Picture of team {{ team.effectiveName }}"
6464
title="Picture of team {{ team.effectiveName }}">
6565
</div>
6666
{% endif %}

0 commit comments

Comments
 (0)