From 2806fa9bb2defd5100cf4a6aefb2bbcd20cb8043 Mon Sep 17 00:00:00 2001 From: Kevin Jilissen Date: Sat, 1 Mar 2025 10:19:14 +0000 Subject: [PATCH] Use CSS and viewport height for editor height --- webapp/public/style_domjudge.css | 2 +- webapp/src/Twig/TwigExtension.php | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/webapp/public/style_domjudge.css b/webapp/public/style_domjudge.css index 7d824d6a71..07d63eab6a 100644 --- a/webapp/public/style_domjudge.css +++ b/webapp/public/style_domjudge.css @@ -737,6 +737,6 @@ blockquote { .editor { width: 100%; - height: 400px; + height: 80vh; border: 1px solid grey; } diff --git a/webapp/src/Twig/TwigExtension.php b/webapp/src/Twig/TwigExtension.php index 8dabb40293..178bd9f369 100644 --- a/webapp/src/Twig/TwigExtension.php +++ b/webapp/src/Twig/TwigExtension.php @@ -850,9 +850,6 @@ public function codeEditor( const element = document.getElementById('__EDITOR__'); const content = element.textContent; element.textContent = ''; - // Adjust editor height to fit window. - const height = $(window).height() - 400; - element.style.height = height + 'px'; const editor = monaco.editor.create(element, { value: content,