mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
fix prev and next button for navigationheader
This commit is contained in:
parent
7c0e2312a1
commit
81ff4641c7
@ -63,6 +63,13 @@ let PieceContainer = React.createClass({
|
||||
UserStore.unlisten(this.onChange);
|
||||
},
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if(this.props.params.pieceId !== nextProps.params.pieceId) {
|
||||
PieceActions.updatePiece({});
|
||||
PieceActions.fetchOne(nextProps.params.pieceId);
|
||||
}
|
||||
},
|
||||
|
||||
onChange(state) {
|
||||
this.setState(state);
|
||||
},
|
||||
@ -72,7 +79,6 @@ let PieceContainer = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
console.log(this.props)
|
||||
if('title' in this.state.piece) {
|
||||
return (
|
||||
<Piece
|
||||
@ -120,12 +126,12 @@ let NavigationHeader = React.createClass({
|
||||
return (
|
||||
<div style={{marginBottom: '1em'}}>
|
||||
<div className="row no-margin">
|
||||
<Link to='piece' params={{pieceId: nav.prev_index ? nav.prev_index : this.props.piece.id}}>
|
||||
<Link className="disable-select" to='piece' params={{pieceId: nav.prev_index ? nav.prev_index : this.props.piece.id}}>
|
||||
<span className="glyphicon glyphicon-chevron-left pull-left" aria-hidden="true">
|
||||
Previous
|
||||
</span>
|
||||
</Link>
|
||||
<Link to='piece' params={{pieceId: nav.next_index ? nav.next_index : this.props.piece.id}}>
|
||||
<Link className="disable-select" to='piece' params={{pieceId: nav.next_index ? nav.next_index : this.props.piece.id}}>
|
||||
<span className="pull-right">
|
||||
Next
|
||||
<span className="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||
|
@ -391,4 +391,11 @@ hr {
|
||||
|
||||
.react-rating-caption {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.disable-select {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
Loading…
Reference in New Issue
Block a user