0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 19:12:41 +00:00

Status bar nearly done, first pass on the split pane workign for edit page

This commit is contained in:
Scott Tolksdorf
2016-01-03 04:39:56 -05:00
parent 29d03c8263
commit 4ff1f3dc37
13 changed files with 255 additions and 74 deletions

View File

@@ -33,48 +33,42 @@ var EditPage = React.createClass({
handleTextChange : function(text){
this.setState({
text : text
text : text,
pending : true
});
//Ajax time
this.save();
},
handleSave : function(){
this.setState({
pending : true
})
save : _.debounce(function(){
request
.put('/homebrew/update/' + this.props.id)
.send({text : this.state.text})
.end((err, res) => {
console.log('err', err);
this.setState({
pending : false
})
})
},
}, 1500),
render : function(){
console.log(this.props.entry);
var temp;
if(this.state.pending){
temp = <div>processing</div>
}
return <div className='editPage'>
<button onClick={this.handleSave}>save</button> {temp}
<Statusbar
editId={this.props.entry.editId}
shareId={this.props.entry.shareId}
isPending={this.state.pending} />
<Editor text={this.state.text} onChange={this.handleTextChange} />
<PHB text={this.state.text} />
<div className='paneSplit'>
<div className='leftPane'>
<Editor text={this.state.text} onChange={this.handleTextChange} />
</div>
<div className='rightPane'>
<PHB text={this.state.text} />
</div>
</div>
</div>
}
});

View File

@@ -1,3 +1,24 @@
.editPage{
.paneSplit{
width : 100%;
max-height: 100%;
.leftPane, .rightPane{
display: inline-block;
vertical-align: top;
position: relative;
min-height: 100%;
}
.leftPane{
width : 40%;
}
.rightPane{
width : 60%;
overflow-y: scroll;
}
}
}