Skip to content

Commit

Permalink
Resize editor to adjust to window size.
Browse files Browse the repository at this point in the history
Otherwise the editor pane is typically way to small.
  • Loading branch information
meisterT committed Mar 1, 2025
1 parent c1d880a commit ede94dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,10 @@ 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,
scrollbar: {
Expand Down

0 comments on commit ede94dc

Please sign in to comment.