mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 03:42:38 +00:00
Fixed a unclick bug with the splitpane
This commit is contained in:
@@ -27,6 +27,7 @@ var Editor = React.createClass({
|
|||||||
ch : 0
|
ch : 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
this.updateEditorSize();
|
this.updateEditorSize();
|
||||||
window.addEventListener("resize", this.updateEditorSize);
|
window.addEventListener("resize", this.updateEditorSize);
|
||||||
@@ -39,8 +40,6 @@ var Editor = React.createClass({
|
|||||||
var paneHeight = this.refs.main.parentNode.clientHeight;
|
var paneHeight = this.refs.main.parentNode.clientHeight;
|
||||||
paneHeight -= this.refs.snippetBar.clientHeight + 1;
|
paneHeight -= this.refs.snippetBar.clientHeight + 1;
|
||||||
this.refs.codeEditor.codeMirror.setSize(null, paneHeight);
|
this.refs.codeEditor.codeMirror.setSize(null, paneHeight);
|
||||||
|
|
||||||
this.refs.codeEditor.updateSize();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleTextChange : function(text){
|
handleTextChange : function(text){
|
||||||
@@ -58,6 +57,10 @@ var Editor = React.createClass({
|
|||||||
this.refs.codeEditor.setCursorPosition(this.cursorPosition.line, this.cursorPosition.ch + injectText.length);
|
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(){
|
renderSnippetGroups : function(){
|
||||||
return _.map(Snippets, (snippetGroup)=>{
|
return _.map(Snippets, (snippetGroup)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user