Просмотр исходного кода

Make sure the editor resizes when the window resizes

Shaddock Heath 9 лет назад
Родитель
Сommit
fab2ee90d8
1 измененных файлов с 5 добавлено и 0 удалено
  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);