Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions webapp/public/js/domjudge.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,3 +1290,11 @@ function initScoreboardSubmissions() {
});
});
}

function resizeEditors() {
// This function assumes that there is at most one tabbed editor in the screen.
const activeEditor = document.querySelector(".tab-pane.active .editor");
const height = $(window).height() - document.body.offsetHeight + activeEditor.clientHeight - 1 + "px";
$('.editor').height(height);
}
$(window).resize(resizeEditors);
1 change: 0 additions & 1 deletion webapp/public/style_domjudge.css
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,5 @@ blockquote {

.editor {
width: 100%;
height: 80vh;
border: 1px solid grey;
}
2 changes: 2 additions & 0 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,7 @@ public function codeEditor(
});
%s
%s
resizeEditors();
});
});
</script>
Expand Down Expand Up @@ -1011,6 +1012,7 @@ public function showDiff(string $id, SubmissionFile $newFile, SubmissionFile $ol
updateMode(e.target.value);
});
updateMode(initialDiffMode);
resizeEditors();
});
});
</script>
Expand Down
Loading