0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 16:12:37 +00:00

Fixed a unclick bug with the splitpane

This commit is contained in:
Scott Tolksdorf
2016-08-20 13:29:28 -04:00
parent 888d3faa4c
commit b134e11a86

View File

@@ -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)=>{