From 22fd41cfb480816a700f998c1962a94810e92031 Mon Sep 17 00:00:00 2001 From: Kevin Jilissen Date: Sat, 29 Nov 2025 17:28:45 +0100 Subject: [PATCH] Disable diff selection if there is no other Also, do not store the preferred diff tag when there is no other diff. This prevents going back to no-diff after viewing a submission without a diff. --- webapp/public/js/domjudge.js | 2 +- webapp/templates/jury/partials/submission_diff.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/public/js/domjudge.js b/webapp/public/js/domjudge.js index 0cb848ba23..68d8a7373b 100644 --- a/webapp/public/js/domjudge.js +++ b/webapp/public/js/domjudge.js @@ -1422,7 +1422,7 @@ function initDiffEditor(editorId) { }); const selected = select[0].options[select[0].selectedIndex]; - if (selected && selected.dataset.tag) { + if (!select[0].disabled && selected && selected.dataset.tag) { setDiffTag(selected.dataset.tag); } diff --git a/webapp/templates/jury/partials/submission_diff.html.twig b/webapp/templates/jury/partials/submission_diff.html.twig index fae494ecae..de391147c4 100644 --- a/webapp/templates/jury/partials/submission_diff.html.twig +++ b/webapp/templates/jury/partials/submission_diff.html.twig @@ -26,7 +26,7 @@ {% endif %}
- {%- for other in otherSubmissions %}