mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
readd delete functionality
This commit is contained in:
parent
f1d3b3968f
commit
52db729a4d
@ -32,6 +32,7 @@ let FileDragAndDropPreview = React.createClass({
|
||||
// don't run it
|
||||
// On the other hand, if the files progress is not yet at a 100%,
|
||||
// just run fineuploader.cancel
|
||||
console.log(this.props.file);
|
||||
if(this.props.handleDeleteFile && this.props.file.progress === 100) {
|
||||
this.props.handleDeleteFile(this.props.file.id);
|
||||
} else if(this.props.handleCancelFile && this.props.file.progress !== 100) {
|
||||
@ -63,6 +64,9 @@ let FileDragAndDropPreview = React.createClass({
|
||||
return (
|
||||
<div
|
||||
className="file-drag-and-drop-position">
|
||||
<div className="delete-file">
|
||||
<span className="glyphicon glyphicon-remove text-center" aria-hidden="true" title="Remove file" onClick={this.handleDeleteFile}/>
|
||||
</div>
|
||||
{previewElement}
|
||||
</div>
|
||||
);
|
||||
|
@ -242,7 +242,7 @@ var ReactS3FineUploader = React.createClass({
|
||||
this.setState(newState);
|
||||
this.createBlob(files[id]);
|
||||
this.props.submitKey(files[id].key);
|
||||
|
||||
|
||||
// also, lets check if after the completion of this upload,
|
||||
// the form is ready for submission or not
|
||||
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
|
||||
|
@ -43,9 +43,29 @@
|
||||
}
|
||||
|
||||
.file-drag-and-drop-position {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin: 0 0 4% 4%;
|
||||
float:left;
|
||||
|
||||
.delete-file {
|
||||
display: block;
|
||||
background-color: black;
|
||||
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
right: -7px;
|
||||
top: -7px;
|
||||
border-radius: 1em;
|
||||
text-align: center;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
span {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.file-drag-and-drop-preview-table-wrapper {
|
||||
|
Loading…
Reference in New Issue
Block a user