Commit 9a810557 authored by chris's avatar chris

fix disable upload button when chapter is being edited

parent f1ac9097
......@@ -63,6 +63,7 @@ export class UploadButton extends React.Component {
}
renderInput () {
let noAction = false
let uploadClass = ''
let text = 'upload word'
let disabled = ''
......@@ -72,8 +73,7 @@ export class UploadButton extends React.Component {
text = 'uploading...'
disabled = styles['no-actions']
}
if (this.isLocked()) return null
if (this.isLocked()) noAction = true
const { accept, title, type, chapter } = this.props
......@@ -82,10 +82,12 @@ export class UploadButton extends React.Component {
<label
htmlFor={'single-file-uploader' + chapter.id}
className={styles.uploadIcon + ' ' + uploadClass + ' ' + disabled}
disabled={noAction}
/>
<label
htmlFor={'single-file-uploader' + chapter.id}
className={styles.uploadText + ' ' + disabled}
disabled={noAction}
>
{text}
</label>
......@@ -96,6 +98,7 @@ export class UploadButton extends React.Component {
title={title}
name='single-file-uploader'
type={type}
disabled={noAction}
/>
</span>
)
......
......@@ -432,11 +432,13 @@ $upload-multiple: #b1b1b1;
}
.lEditing {
background: $dark-grey;
background: $main-grey;
bottom: 3px;
color: $white;
font-style: italic;
font-weight: 200;
padding: 5px;
position: relative;
text-decoration: none;
&:hover {
border-bottom: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment