Commit 7b734009 authored by chris's avatar chris

remove unused code plus fixes

parent ffc56295
......@@ -25,46 +25,6 @@ class ChapterTitle extends React.Component {
browserHistory.push(url)
}
renderHasContent () {
const { chapter, type } = this.props
const source = chapter.source || ''
const hasContent = source.trim().length > 0
if (!hasContent) return null
// TODO -- move styles to classes (after css refactor)
let marginTop
switch (type) {
case 'part':
marginTop = '4px'
break
case 'chapter':
marginTop = '2px'
break
default:
marginTop = '5px'
break
}
const elementStyles = {
color: '#3e644b',
float: 'left',
fontSize: '14px',
marginRight: '7px',
marginTop
}
const hoverTitle = `This ${type} has content`
return (
<i
className='fa fa-check-circle'
style={elementStyles}
title={hoverTitle}
/>
)
}
renderUploadIndicator () {
const { isUploadInProgress } = this.props
// console.log('is uploading', isUploadInProgress)
......@@ -123,7 +83,6 @@ class ChapterTitle extends React.Component {
}
render () {
// const hasContent = this.renderHasContent()
const title = this.renderTitle()
const uploadIndicator = this.renderUploadIndicator()
const renameEmptyError = this.renderError()
......@@ -131,7 +90,6 @@ class ChapterTitle extends React.Component {
return (
<div className={styles.chapterTitle}>
{/* { hasContent } */}
{ title }
{/* { this.props.chapter.index } */}
{ uploadIndicator }
......
......@@ -23,8 +23,7 @@ export class UploadButton extends React.Component {
const { chapter, convertFile, toggleUpload, update } = this.props
toggleUpload()
convertFile(file).then(response => {
convertFile(file).then((response) => {
const patch = {
id: chapter.id,
source: response.converted
......@@ -59,28 +58,29 @@ export class UploadButton extends React.Component {
renderInput () {
if (this.isLocked()) return null
const { accept, title, type } = this.props
const { accept, title, type, chapter } = this.props
return (
<span>
<label
htmlFor='file-uploader'
htmlFor={'single-file-uploader' + chapter.id}
className={styles.uploadIcon}
/>
<label
htmlFor={'single-file-uploader' + chapter.id}
className={styles.uploadText}
>
</label>
<label
htmlFor='file-uploader'
className={styles.uploadText}
> UPLOAD WORD
</label>
UPLOAD WORD
</label>
<input
id={'single-file-uploader' + chapter.id}
accept={accept}
onChange={this.handleFileUpload}
title={title}
name='single-file-uploader'
type={type}
/>
</span>
</span>
)
}
......
......@@ -493,30 +493,33 @@ $blue: #0d78f2;
}
}
@media all and (max-width: 768px) {
@media (min-width:215px) and (max-width:1200px) {
.pagePosition {
float:left!important;
padding-top:20px!important;
}
.grabIcon {
width:10%!important;
.chapterActions {
bottom: 118px!important;
}
.grabContainer {
display: none!important;
}
.chapterMainContent{
// width:90%!important;
}
.secondLineContainer {
padding-top:0!important;
padding-top:10!important;
}
.sectionHeader {
.sectionTitle {
background-color: $main-grey;
// background-color: $main-grey;
padding: 10px 30px 10px 10px;
}
}
.sectionChapters {
padding-top:7%!important;
// padding-top:7%!important;
}
}
......
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