From f28b38852d78fad9b96cd2fb33372a094127d6a6 Mon Sep 17 00:00:00 2001 From: Arnold Daniels Date: Tue, 15 Jan 2013 03:01:03 +0100 Subject: [PATCH] Fileupload fix: Don't need to get file on clear --- js/bootstrap-fileupload.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/bootstrap-fileupload.js b/js/bootstrap-fileupload.js index a9062250..1f8378f7 100644 --- a/js/bootstrap-fileupload.js +++ b/js/bootstrap-fileupload.js @@ -65,9 +65,10 @@ }, change: function(e, invoked) { - var file = e.target.files !== undefined ? e.target.files[0] : (e.target.value ? { name: e.target.value.replace(/^.+\\/, '') } : null) if (invoked === 'clear') return + var file = e.target.files !== undefined ? e.target.files[0] : (e.target.value ? { name: e.target.value.replace(/^.+\\/, '') } : null) + if (!file) { this.clear() return