1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-13 05:25:58 +00:00

Brew content will now not server render jsut incase it has malformed html, so it wont break the page

This commit is contained in:
Scott Tolksdorf
2016-05-18 00:20:07 -04:00
parent fc3587d6cb
commit 6209fcd5cb
3 changed files with 8 additions and 4 deletions

View File

@@ -15,7 +15,8 @@ var BrewRenderer = React.createClass({
getInitialState: function() {
return {
viewablePageNumber: 0,
height : 0
height : 0,
isMounted : false
};
},
totalPages : 0,
@@ -23,7 +24,8 @@ var BrewRenderer = React.createClass({
componentDidMount: function() {
this.setState({
height : this.refs.main.parentNode.clientHeight
height : this.refs.main.parentNode.clientHeight,
isMounted : true
});
},
handleScroll : function(e){
@@ -36,6 +38,8 @@ var BrewRenderer = React.createClass({
},
shouldRender : function(pageText, index){
if(!this.state.isMounted) return false;
var viewIndex = this.state.viewablePageNumber;
if(index == viewIndex - 1) return true;
if(index == viewIndex) return true;

View File

@@ -11,7 +11,7 @@ var Navbar = React.createClass({
<Nav.item href='/homebrew' className='homebrewLogo'>
<div>The Homebrewery</div>
</Nav.item>
<Nav.item>v2.0.0</Nav.item>
<Nav.item>v2.0.1</Nav.item>
</Nav.section>
{this.props.children}
</Nav.base>

View File

@@ -1,7 +1,7 @@
{
"name": "naturalcrit",
"description": "D&D Tools for the discerning DM",
"version": "2.0.0",
"version": "2.0.1",
"scripts": {
"postinstall": "gulp prod",
"start": "node server.js"