Browse Source

Only clear when the native file input is cleared.

Jesper Jonsson 10 năm trước cách đây
mục cha
commit
9f01e09220
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  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;
             }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
js/fileinput.min.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác