From c6e1374b578581be32596f88146ff6cd948dfa3b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 20 Jun 2018 18:24:49 +0200 Subject: send recordings to results page --- app/client/common/fileList.component.js | 2 +- app/client/common/textInput.component.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'app/client/common') diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index 47c4c52..b71faae 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -89,7 +89,7 @@ export const FileRow = props => { {file.persisted === false ? {name} : (linkFiles && file.url) - ? { if (!(e.metaKey || e.ctrlKey || e.altKey)) { e.preventDefault(); onClick && onClick(file, e) }}} href={file.url}>{name} + ? { if (!(e.metaKey || e.ctrlKey || e.altKey) && onClick) { e.preventDefault(); onClick && onClick(file, e) }}} href={file.url}>{name} : onClick && onClick(file, e)}>{name} } diff --git a/app/client/common/textInput.component.js b/app/client/common/textInput.component.js index 1e2ca01..a3739d4 100644 --- a/app/client/common/textInput.component.js +++ b/app/client/common/textInput.component.js @@ -3,14 +3,23 @@ import { h, Component } from 'preact' class TextInput extends Component { constructor(props){ super(props) + this.state = { value: null, changed: false } this.handleInput = this.handleInput.bind(this) this.handleKeydown = this.handleKeydown.bind(this) } handleInput(e){ + this.setState({ + value: e.target.value, + changed: true, + }) this.props.onInput && this.props.onInput(e.target.value) } handleKeydown(e){ if (e.keyCode === 13) { + this.setState({ + value: e.target.value, + changed: false, + }) this.props.onSave && this.props.onSave(e.target.value) } } @@ -21,7 +30,7 @@ class TextInput extends Component { {this.props.title}