diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-03-22 11:16:56 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-03-22 11:16:56 +0100 |
| commit | 63313cf8d7954f533c2b5dd954a3f6406fc57d17 (patch) | |
| tree | 6528beb330c57f2383f91aca9f919585d47753db | |
| parent | 00750b66609da7fdd457e1c908c15f4506599989 (diff) | |
prev btn
| -rw-r--r-- | scraper/client/paper/paper.verify.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index 8cb14d84..98692588 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -99,6 +99,24 @@ class PaperVerify extends Component { this.next(false) } + prev() { + const { key } = this.props.api.paperInfo.dataset + const { paperInfo } = this.props.api + let citationIndex = (paperInfo.citations || []) + .findIndex(f => f.id === this.state.citation.id) + if (citationIndex === -1) { + history.push('/paper/' + key + '/info/') + } else { + citationIndex -= 1 + if (citationIndex < 0) { + history.push('/paper/' + key + '/info/') + } else { + let nextId = paperInfo.citations[citationIndex].id + history.push('/paper/' + key + '/verify/' + nextId) + } + } + } + next() { const { key } = this.props.api.paperInfo.dataset const { paperInfo } = this.props.api @@ -228,6 +246,11 @@ class PaperVerify extends Component { <button className='btn' + onClick={this.prev.bind(this)} + >{'Prev >'}</button> + + <button + className='btn' onClick={this.next.bind(this)} >{'Next >'}</button> </div> |
