Skip to content

Commit ede94dc

Browse files
committed
Resize editor to adjust to window size.
Otherwise the editor pane is typically way to small.
1 parent c1d880a commit ede94dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

webapp/src/Twig/TwigExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,10 @@ public function codeEditor(
849849
const element = document.getElementById('__EDITOR__');
850850
const content = element.textContent;
851851
element.textContent = '';
852+
// Adjust editor height to fit window.
853+
const height = $(window).height() - 400;
854+
element.style.height = height + 'px';
855+
852856
const editor = monaco.editor.create(element, {
853857
value: content,
854858
scrollbar: {

0 commit comments

Comments
 (0)