0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-22 05:17:51 +00:00

Last tweaks

This commit is contained in:
Scott Tolksdorf
2016-05-29 13:19:21 -04:00
parent 7eb47d7db0
commit 6474825ffb
4 changed files with 40 additions and 36 deletions

View File

@@ -1,6 +1,7 @@
var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var request = require("superagent");
var Nav = require('naturalcrit/nav/nav.jsx');
var Navbar = require('../../navbar/navbar.jsx');
@@ -24,6 +25,18 @@ var HomePage = React.createClass({
text: this.props.welcomeText
};
},
handleSave : function(){
request.post('/homebrew/api')
.send({
title : 'Change This',
text : this.state.text
})
.end((err, res)=>{
if(err) return;
var brew = res.body;
window.location = '/homebrew/edit/' + brew.editId;
});
},
handleSplitMove : function(){
this.refs.editor.update();
},
@@ -60,7 +73,7 @@ var HomePage = React.createClass({
</SplitPane>
</div>
<div className={cx('floatingSaveButton', {show : this.props.welcomeText != this.state.text})}>
<div className={cx('floatingSaveButton', {show : this.props.welcomeText != this.state.text})} onClick={this.handleSave}>
Save current <i className='fa fa-save' />
</div>