mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
debug
This commit is contained in:
parent
e44ae60b75
commit
dbbf9fd233
@ -17,6 +17,10 @@ let FileDragAndDropPreview = React.createClass({
|
|||||||
handleCancelFile: React.PropTypes.func
|
handleCancelFile: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
|
toggleUploadProcess() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
handleDeleteFile() {
|
handleDeleteFile() {
|
||||||
// handleDeleteFile is optional, so if its not submitted,
|
// handleDeleteFile is optional, so if its not submitted,
|
||||||
// don't run it
|
// don't run it
|
||||||
@ -40,12 +44,14 @@ let FileDragAndDropPreview = React.createClass({
|
|||||||
previewElement = (<FileDragAndDropPreviewImage
|
previewElement = (<FileDragAndDropPreviewImage
|
||||||
onClick={this.handleDeleteFile}
|
onClick={this.handleDeleteFile}
|
||||||
progress={this.props.file.progress}
|
progress={this.props.file.progress}
|
||||||
url={this.props.file.url}/>);
|
url={this.props.file.url}
|
||||||
|
toggleUploadProcess={this.toggleUploadProcess}/>);
|
||||||
} else {
|
} else {
|
||||||
previewElement = (<FileDragAndDropPreviewOther
|
previewElement = (<FileDragAndDropPreviewOther
|
||||||
onClick={this.handleDeleteFile}
|
onClick={this.handleDeleteFile}
|
||||||
progress={this.props.file.progress}
|
progress={this.props.file.progress}
|
||||||
type={this.props.file.type.split('/')[1]}/>);
|
type={this.props.file.type.split('/')[1]}
|
||||||
|
toggleUploadProcess={this.toggleUploadProcess}/>);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -3,18 +3,17 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ProgressBar from 'react-progressbar';
|
import ProgressBar from 'react-progressbar';
|
||||||
|
|
||||||
import AppConstants from '../../constants/application_constants';
|
|
||||||
|
|
||||||
let FileDragAndDropPreviewImage = React.createClass({
|
let FileDragAndDropPreviewImage = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
progress: React.PropTypes.number,
|
progress: React.PropTypes.number,
|
||||||
url: React.PropTypes.string,
|
url: React.PropTypes.string,
|
||||||
onClick: React.PropTypes.func
|
toggleUploadProcess: React.PropTypes.func,
|
||||||
|
downloadFile: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
paused: false
|
paused: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -38,20 +37,32 @@ let FileDragAndDropPreviewImage = React.createClass({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
downloadFile() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let imageStyle = {
|
let imageStyle = {
|
||||||
backgroundImage: 'url("' + this.props.url + '")',
|
backgroundImage: 'url("' + this.props.url + '")',
|
||||||
backgroundSize: 'cover'
|
backgroundSize: 'cover'
|
||||||
};
|
};
|
||||||
|
|
||||||
//let actionSymbol = this.state.loading ? <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} /> : <span className="glyphicon glyphicon-remove delete-file" aria-hidden="true" title="Delete or cancel upload" onClick={this.onClick} />;
|
let actionSymbol;
|
||||||
let actionSymbol = this.state.paused ? <span className="glyphicon glyphicon-pause action-file" aria-hidden="true" title="Pause upload" onClick={this.toggleUploadProcess}/> : <span className="glyphicon glyphicon-play action-file" aria-hidden="true" title="Pause upload" onClick={this.toggleUploadProcess}/>
|
|
||||||
|
if(this.props.progress !== 100 && this.state.paused) {
|
||||||
|
actionSymbol = <span className="glyphicon glyphicon-pause action-file" aria-hidden="true" title="Pause upload" onClick={this.toggleUploadProcess}/>;
|
||||||
|
} else if(this.props.progress !== 100 && !this.state.paused) {
|
||||||
|
actionSymbol = <span className="glyphicon glyphicon-play action-file" aria-hidden="true" title="Resume uploading" onClick={this.toggleUploadProcess}/>;
|
||||||
|
} else {
|
||||||
|
actionSymbol = <span className="glyphicon glyphicon-download action-file" aria-hidden="true" title="Download file" onClick={this.props.downloadFile}/>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="file-drag-and-drop-preview-image"
|
className="file-drag-and-drop-preview-image"
|
||||||
style={imageStyle}>
|
style={imageStyle}>
|
||||||
<ProgressBar completed={this.props.progress} color="black"/>
|
<ProgressBar completed={this.props.progress} color="black"/>
|
||||||
|
{actionSymbol}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -530,7 +530,7 @@ let FileUploader = React.createClass({
|
|||||||
setUploadStatus={this.props.setUploadStatus}
|
setUploadStatus={this.props.setUploadStatus}
|
||||||
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
||||||
session={{
|
session={{
|
||||||
endpoint: AppConstants.serverUrl + 'api/ownership/loans/contract/',
|
endpoint: AppConstants.serverUrl + 'api/blob/otherdatas/fineuploader_session/',
|
||||||
customHeaders: {
|
customHeaders: {
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user