mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Replace history for slider
This commit is contained in:
parent
927c89f342
commit
695a195e55
@ -34,7 +34,7 @@ let SlidesContainer = React.createClass({
|
||||
// check if slide_num was defined, and if not then default to 0
|
||||
let queryParams = this.getQuery();
|
||||
if(!('slide_num' in queryParams)) {
|
||||
this.transitionTo(this.getPathname(), null, {slide_num: 0});
|
||||
this.replaceWith(this.getPathname(), null, {slide_num: 0});
|
||||
}
|
||||
|
||||
// init container width
|
||||
@ -60,7 +60,7 @@ let SlidesContainer = React.createClass({
|
||||
setSlideNum(slideNum) {
|
||||
if(slideNum < 0 || slideNum < React.Children.count(this.props.children)) {
|
||||
|
||||
this.transitionTo(this.getPathname(), null, {slide_num: slideNum});
|
||||
this.replaceWith(this.getPathname(), null, {slide_num: slideNum});
|
||||
this.setState({
|
||||
slideNum: slideNum
|
||||
});
|
||||
@ -104,4 +104,4 @@ let SlidesContainer = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
export default SlidesContainer;
|
||||
export default SlidesContainer;
|
||||
|
@ -3,11 +3,19 @@
|
||||
import React from 'react';
|
||||
import PieceList from '../../../piece_list';
|
||||
|
||||
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
||||
|
||||
|
||||
let PrizePieceList = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<PieceList redirectTo="register_piece" />
|
||||
<div>
|
||||
<ButtonLink to="register_piece">
|
||||
Submit a new artwork to the prize
|
||||
</ButtonLink>
|
||||
|
||||
<PieceList redirectTo="register_piece" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user