1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

Added possibility to remove the file after selecting this

This commit is contained in:
juanmont 2016-11-18 20:35:48 +01:00
parent 08a51609eb
commit 8dcabb7523
2 changed files with 14 additions and 2 deletions

View File

@ -289,10 +289,21 @@ define(function(require) {
fileName = file.fileName;
file_input = fileName;
$('#file-uploader-input', context).hide()
$('#file-uploader-input', context).hide();
$("#file-uploader-label", context).html(file.fileName);
$("#file-uploader-label", context).show();
$('#close_image', context).show();
});
var abort = false;
$('#close_image', context).on('click', function(){
console.log("click");
$("#file-uploader-label", context).hide();
$('#close_image', context).hide();
$('#file-uploader-input', context).show();
fileName= '';
that.uploader.files.length = 0;
});
that.uploader.on('uploadStart', function() {
var myThis = this;
if(!(myThis.progress() > 0)){

View File

@ -92,6 +92,7 @@
<div class="row">
<div id="file-uploader" class="large-12 columns text-center">
<label id="file-uploader-label" for="file-uploader-input"></label>
<i id="close_image" class="fa fa-times-circle fa fa-lg close_image" hidden="true"></i>
<input id="file-uploader-input" type="file"/>
</div>
</div>