summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/containers/timeline.container.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/views/align/containers/timeline.container.js')
-rw-r--r--animism-align/frontend/views/align/containers/timeline.container.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/animism-align/frontend/views/align/containers/timeline.container.js b/animism-align/frontend/views/align/containers/timeline.container.js
index 69f2496..a0f4d3a 100644
--- a/animism-align/frontend/views/align/containers/timeline.container.js
+++ b/animism-align/frontend/views/align/containers/timeline.container.js
@@ -49,6 +49,26 @@ class Timeline extends Component {
return
}
// console.log(e.keyCode)
+ if (e.metaKey && this.props.selectedAnnotation.id) {
+ const { selectedAnnotation } = this.props
+ switch (e.keyCode) {
+ case 38: // up
+ e.preventDefault()
+ selectedAnnotation.start_ts -= e.shiftKey ? 1 : 0.1
+ actions.align.updateSelectedAnnotation(selectedAnnotation)
+ actions.audio.seek(selectedAnnotation.start_ts)
+ actions.align.setCursor(selectedAnnotation.start_ts)
+ break
+ case 40: // down
+ e.preventDefault()
+ selectedAnnotation.start_ts += e.shiftKey ? 1 : 0.1
+ actions.align.updateSelectedAnnotation(selectedAnnotation)
+ actions.audio.seek(selectedAnnotation.start_ts)
+ actions.align.setCursor(selectedAnnotation.start_ts)
+ break
+ }
+ return
+ }
if (e.shiftKey) {
switch (e.keyCode) {
case 187: // plus
@@ -139,6 +159,7 @@ class Timeline extends Component {
const mapStateToProps = state => ({
timeline: state.align.timeline,
annotation: state.align.annotation,
+ selectedAnnotation: state.align.selectedAnnotation,
audio: state.audio,
text: state.site.text,
})