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

Added in an editable title navitem

This commit is contained in:
Scott Tolksdorf
2016-05-09 14:00:12 -04:00
parent 15ad171c2d
commit d5b8c60317
3 changed files with 74 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ var request = require("superagent");
var Nav = require('naturalcrit/nav/nav.jsx');
var Navbar = require('../../navbar/navbar.jsx');
var EditTitle = require('../../navbar/editTitle.navitem.jsx');
var SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
@@ -31,9 +32,8 @@ var NewPage = React.createClass({
text : storage
})
}
window.onbeforeunload = function(e){
return "Your homebrew isn't saved. Are you sure you want to leave?";
//return "Your homebrew isn't saved. Are you sure you want to leave?";
};
},
@@ -46,6 +46,12 @@ var NewPage = React.createClass({
this.refs.editor.update();
},
handleTitleChange : function(title){
this.setState({
title : title
});
},
handleTextChange : function(text){
this.setState({
text : text
@@ -93,7 +99,7 @@ var NewPage = React.createClass({
renderNavbar : function(){
return <Navbar>
<Nav.section>
<Nav.item>{this.state.title}</Nav.item>
<EditTitle title={this.state.title} onChange={this.handleTitleChange} />
</Nav.section>
<Nav.section>