summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-09 18:08:29 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-09 18:08:29 +0100
commit6d2df4175ed9ef611a679eb6379755f9c0e7835a (patch)
treed837c8d9705d06636ddd41e55da8e190328f67b5
parent04e2c665cc91efc8672c56ad5de197a00315623c (diff)
clicking the first work seeks to the beginning of the section
-rw-r--r--animism-align/frontend/app/views/viewer/checklist/checklist.content.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js
index d0f115c..8beb9af 100644
--- a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js
+++ b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js
@@ -8,8 +8,13 @@ import { thumbnailURL } from 'app/utils/annotation.utils'
import { PlayIcon } from '../nav/viewer.icons'
class ChecklistContent extends Component {
- handleMediaSelection(section, mediaItem) {
- actions.viewer.seekToMediaItem(section, mediaItem)
+ handleMediaSelection(section, mediaItem, i) {
+ if (i === 0 && section.index !== 0) {
+ actions.viewer.hideNavComponent('checklist')
+ actions.viewer.seekToSection(section)
+ } else {
+ actions.viewer.seekToMediaItem(section, mediaItem)
+ }
}
render() {
@@ -27,7 +32,7 @@ class ChecklistContent extends Component {
<div
className="checklist-row"
key={section.index + "_" + i}
- onClick={() => this.handleMediaSelection(section, mediaItem)}
+ onClick={() => this.handleMediaSelection(section, mediaItem, i)}
>
<div className="media-id">
{pad(section.mediaIndex + i + 1, 2)}