From b134e11a863453fd755da6a8a5ff79ceb4b2b25f Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Sat, 20 Aug 2016 13:29:28 -0400 Subject: [PATCH] Fixed a unclick bug with the splitpane --- client/homebrew/editor/editor.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 7a8dcb061..d79ef4a98 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -27,6 +27,7 @@ var Editor = React.createClass({ ch : 0 }, + componentDidMount: function() { this.updateEditorSize(); window.addEventListener("resize", this.updateEditorSize); @@ -39,8 +40,6 @@ var Editor = React.createClass({ var paneHeight = this.refs.main.parentNode.clientHeight; paneHeight -= this.refs.snippetBar.clientHeight + 1; this.refs.codeEditor.codeMirror.setSize(null, paneHeight); - - this.refs.codeEditor.updateSize(); }, handleTextChange : function(text){ @@ -58,6 +57,10 @@ var Editor = React.createClass({ this.refs.codeEditor.setCursorPosition(this.cursorPosition.line, this.cursorPosition.ch + injectText.length); }, + //Called when there are changes to the editor's dimensions + update : function(){ + this.refs.codeEditor.updateSize(); + }, renderSnippetGroups : function(){ return _.map(Snippets, (snippetGroup)=>{