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 f82c83e commit 1bfe365
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 1bfe365

Please sign in to comment.