Procházet zdrojové kódy

Fix #833: Correct validation and defaults init for `allowedPreviewTypes`

Kartik Visweswaran před 8 roky
rodič
revize
7defcfc17b
3 změnil soubory, kde provedl 7 přidání a 3 odebrání
  1. 3 2
      CHANGE.md
  2. 4 1
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 3 - 2
CHANGE.md

@@ -15,8 +15,9 @@ Change Log: `bootstrap-fileinput`
 8. (bug #826): Extend language configuration to consider defaults.
 9. (enh #828): Allow drag sort of single uploaded thumbnails with `initialPreview` config set (post upload).
 10. (enh #831): Update Finnish Translations.
-11. (enh #837): Update Czech Translations.
-12. (bug #839): Correct `initialPreview` generation and sortable behavior for async uploads.
+11. (bug #833): Correct validation and defaults init for `allowedPreviewTypes`.
+12. (enh #837): Update Czech Translations.
+13. (bug #839): Correct `initialPreview` generation and sortable behavior for async uploads.
 
 ## version 4.3.6
 

+ 4 - 1
js/fileinput.js

@@ -630,6 +630,9 @@
             if (!self.isPreviewable) {
                 self.showPreview = false;
             }
+            if (self.allowedPreviewTypes === undefined) {
+                self.allowedPreviewTypes = defaultPreviewTypes;
+            }
             self.uploadFileAttr = !isEmpty($el.attr('name')) ? $el.attr('name') : 'file_data';
             self.reader = null;
             self.formdata = {};
@@ -3268,7 +3271,7 @@
         },
         preferIconicPreview: false,
         preferIconicZoomPreview: false,
-        allowedPreviewTypes: defaultPreviewTypes,
+        allowedPreviewTypes: undefined,
         allowedPreviewMimeTypes: null,
         allowedFileTypes: null,
         allowedFileExtensions: null,

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
js/fileinput.min.js


Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů