Browse Source

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

Kartik Visweswaran 8 years ago
parent
commit
7defcfc17b
3 changed files with 7 additions and 3 deletions
  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.
 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).
 9. (enh #828): Allow drag sort of single uploaded thumbnails with `initialPreview` config set (post upload).
 10. (enh #831): Update Finnish Translations.
 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
 ## version 4.3.6
 
 

+ 4 - 1
js/fileinput.js

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

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