mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 02:14:39 +00:00
Getting ready to switch to jsx
This commit is contained in:
@@ -18,7 +18,6 @@ var SheetEditor = React.createClass({
|
|||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
var paneHeight = this.refs.main.parentNode.clientHeight;
|
var paneHeight = this.refs.main.parentNode.clientHeight;
|
||||||
paneHeight -= this.refs.snippetBar.clientHeight + 1;
|
|
||||||
this.refs.codeEditor.codeMirror.setSize(null, paneHeight);
|
this.refs.codeEditor.codeMirror.setSize(null, paneHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -35,7 +34,7 @@ var SheetEditor = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div className='sheetEditor'>
|
return <div className='sheetEditor' ref='main'>
|
||||||
<CodeEditor
|
<CodeEditor
|
||||||
ref='codeEditor'
|
ref='codeEditor'
|
||||||
wrap={true}
|
wrap={true}
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ var TPK = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//remove later
|
||||||
|
componentDidMount: function() {
|
||||||
|
this.setState({
|
||||||
|
sheetCode : localStorage.getItem('temp')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
handleSplitMove : function(){
|
handleSplitMove : function(){
|
||||||
this.refs.editor.update();
|
this.refs.editor.update();
|
||||||
},
|
},
|
||||||
@@ -25,7 +32,9 @@ var TPK = React.createClass({
|
|||||||
handleCodeChange : function(code){
|
handleCodeChange : function(code){
|
||||||
this.setState({
|
this.setState({
|
||||||
sheetCode : code
|
sheetCode : code
|
||||||
})
|
});
|
||||||
|
|
||||||
|
localStorage.setItem('temp', code);
|
||||||
},
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
flex-direction : column;
|
flex-direction : column;
|
||||||
.content{
|
.content{
|
||||||
position : relative;
|
position : relative;
|
||||||
height : calc(~"100% - 29px"); //Navbar height
|
//height : calc(~"100% - 29px"); //Navbar height
|
||||||
|
|
||||||
|
height : 100%;
|
||||||
|
|
||||||
flex : auto;
|
flex : auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ var gulp = vitreumTasks(gulp, {
|
|||||||
"codemirror/mode/gfm/gfm.js",
|
"codemirror/mode/gfm/gfm.js",
|
||||||
'codemirror/mode/javascript/javascript.js',
|
'codemirror/mode/javascript/javascript.js',
|
||||||
|
|
||||||
|
|
||||||
"moment",
|
"moment",
|
||||||
"superagent",
|
"superagent",
|
||||||
"marked",
|
"marked",
|
||||||
|
|||||||
Reference in New Issue
Block a user