Browse Source

Make sure the editor resizes when the window resizes

Shaddock Heath 9 years ago
parent
commit
fab2ee90d8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Data/AtomicEditor/CodeEditor/MonacoEditor.html

+ 5 - 0
Data/AtomicEditor/CodeEditor/MonacoEditor.html

@@ -46,6 +46,11 @@
             require(['vs/editor/editor.main'], function() {
                 var editor = monaco.editor.create(document.getElementById('editor'));
 
+                // Make sure the editor resizes when the window resizes
+                window.onresize = ()=>{
+                    editor.layout();
+                }
+
                 System.import('./source/editorCore/interop').then((module) => {
                     module.default.getInstance().setEditor(editor);
                     resolve(module.default);