Browse Source

Only clear when the native file input is cleared.

Jesper Jonsson 10 years ago
parent
commit
9f01e09220
2 changed files with 3 additions and 2 deletions
  1. 3 2
      js/fileinput.js
  2. 0 0
      js/fileinput.min.js

+ 3 - 2
js/fileinput.js

@@ -292,7 +292,7 @@
                 }, 100);  
             });
             $btnFile.on('click', function (ev) {
-                self.clear(false);
+                self.$element.trigger('filebrowse');
                 $cap.focus();
             });
             $el.closest('form').on('reset', $.proxy(self.reset, self));
@@ -697,7 +697,8 @@
             } else {
                 tfiles = e.target.files;
             }
-            if (tfiles.length === 0) {
+            if (isEmpty(tfiles) || tfiles.length === 0) {
+                self.clear(false);
                 $el.trigger('fileselectnone');
                 return;
             }

File diff suppressed because it is too large
+ 0 - 0
js/fileinput.min.js


Some files were not shown because too many files changed in this diff