1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

readd delete functionality

This commit is contained in:
Tim Daubenschütz 2015-06-29 17:59:35 +02:00
parent f1d3b3968f
commit 52db729a4d
3 changed files with 25 additions and 1 deletions

View File

@ -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>
);

View File

@ -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 {