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:
@@ -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>
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user