Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Fixed #1 (Resize breaks editor lines)
Browse files Browse the repository at this point in the history
  • Loading branch information
uppe-r committed Jun 5, 2017
1 parent 4097aea commit 7f36a96
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions app/components/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,7 @@ class MonacoEditor extends React.Component {
...options,
});
window.addEventListener('resize', () => {
const editorNode = document.getElementsByClassName(containerElement.className)[0];
const parent = editorNode.parentElement;
editorNode.style.width = `${parent.clientWidth}px`;
editorNode.style.height = `${parent.clientHeight}px`;

editorNode.firstElementChild.style.width = `${parent.clientWidth}px`;
editorNode.firstElementChild.style.height = `${parent.clientHeight}px`;

editorNode.firstElementChild.firstElementChild.style.width = `${parent.clientWidth}px`;
editorNode.firstElementChild.firstElementChild.style.height = `${parent.clientHeight}px`;

editorNode.firstElementChild.firstElementChild.firstElementChild.style.width = `${parent.clientWidth}px`;
editorNode.firstElementChild.firstElementChild.firstElementChild.style.height = `${parent.clientHeight}px`;

editorNode.getElementsByClassName('monaco-scrollable-element')[0].style.width = `${parent.clientWidth - 46}px`;
this.editor.layout();
});
// After initializing monaco editor
this.editorDidMount(this.editor, context.monaco);
Expand Down

0 comments on commit 7f36a96

Please sign in to comment.