From 2d79b5a988bda8dbca2dcef8db80c441a375d781 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 17 Feb 2013 18:04:32 +0000 Subject: [PATCH] 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 --- lib/file-control.php | 2 +- lib/ice-coder.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index f98f63b..5b28b90 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -135,7 +135,7 @@ if ($_GET['action']=="upload") { echo ""; } - echo ""; + echo ""; } // If we're due to rename a file/folder... diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 3e0113d..7c69683 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -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