Browse Source

fix: drop event will not trigger excelPreview @ init

Hugh Harlequin 1 năm trước cách đây
mục cha
commit
c9556f5097
2 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 0 0
      js/dist/excel-preview.min.js
  2. 6 1
      js/src/excel-preview.js

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


+ 6 - 1
js/src/excel-preview.js

@@ -32,7 +32,12 @@
         init: function () {
             var e = this;
             let input = $(e.element).prev('input[type=file]');
-            $(e.element).prev('input[type=file]').fileinput(e.settings).on('change', function (file) {
+            let namespace = input.data('fileinput').namespace;
+            input.fileinput(e.settings).on('change', function (file) {
+                e.excelPreview(file);
+            })
+            /* let drop event trigger change*/
+            input.on('change' + namespace, function (file){
                 e.excelPreview(file);
             })
         },

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