Reset fileInput and only act if we have file

Reset fileInput back to an empty value after upload (success or fail)
Only if value isn't empty action the upload
This commit is contained in:
Matt Pass
2013-02-17 18:04:32 +00:00
parent 86ae5e14b4
commit 2d79b5a988
2 changed files with 6 additions and 4 deletions

View File

@@ -135,7 +135,7 @@ if ($_GET['action']=="upload") {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
}
echo "<script>top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
echo "<script>top.ICEcoder.hideFileMenu();top.document.getElementById('fileInput').value='';top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
}
// If we're due to rename a file/folder...

View File

@@ -637,9 +637,11 @@ var ICEcoder = {
top.document.getElementById("fileInput").click();
},
uploadFilesSubmit: function(obj) {
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
document.getElementById('uploadFilesForm').submit();
event.preventDefault();
if (top.document.getElementById('fileInput').value!="") {
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
document.getElementById('uploadFilesForm').submit();
event.preventDefault();
}
},
// Show menu on right clicking in file manager