Skip to content

Commit c233160

Browse files
committed
Update to release v5.5.0 fixes #1694
1 parent 48f7198 commit c233160

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

CHANGE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Change Log: `bootstrap-fileinput`
55

66
**Major Release: BC Breaking**
77

8-
**Date**: 28-Jun-2022
8+
**Date**: 29-Jun-2022
99

1010
- (enh #1800): Styling enhancements for thumbnail content and rotatable images.
1111
- (enh #1799): Correct translations containing `{maxSize}, {minSize}, {size}`.
@@ -47,6 +47,8 @@ $input.on('fileuploaderror', function(event, data) {
4747
// $input.fileinput('showUserError', userMessage);
4848
});
4949
```
50+
- (enh #1694): Thumbnail of images only but detailed preview/iconic view of all other files.
51+
- New property `alwaysPreviewFileExtensions` - setup as an array list of extensions whose content will always be shown in preview (irrespective of `preferIconPreview` or `previewFileIconSettings` which will be used to control icon preview for configured types).
5052

5153
## version 5.2.8
5254

js/fileinput.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4369,12 +4369,13 @@
43694369
zoomData
43704370
) {
43714371
var self = this, caption = self.slug(fname), prevContent, zoomContent = '', styleAttribs = '',
4372-
filename = fnameUpdated || fname,
4372+
filename = fnameUpdated || fname, isIconic, ext = filename.split('.').pop().toLowerCase(),
43734373
screenW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
43744374
config, title = caption, alt = caption, typeCss = 'type-default', getContent, addFrameCss,
43754375
footer = foot || self._renderFileFooter(cat, caption, size, 'auto', isError), isRotatable,
4376-
forcePrevIcon = self.preferIconicPreview, forceZoomIcon = self.preferIconicZoomPreview,
4377-
newCat = forcePrevIcon ? 'other' : cat, ext = filename.split('.').pop().toLowerCase();
4376+
alwaysPreview = $.inArray(ext, self.alwaysPreviewFileExtensions) !== -1,
4377+
forcePrevIcon = self.preferIconicPreview && !alwaysPreview,
4378+
forceZoomIcon = self.preferIconicZoomPreview && !alwaysPreview, newCat = forcePrevIcon ? 'other' : cat;
43784379
config = screenW < 400 ? (self.previewSettingsSmall[newCat] || self.defaults.previewSettingsSmall[newCat]) :
43794380
(self.previewSettings[newCat] || self.defaults.previewSettings[newCat]);
43804381
if (config) {
@@ -4448,7 +4449,8 @@
44484449
}
44494450
addFrameCss = 'kv-preview-thumb';
44504451
if (isRotatable) {
4451-
addFrameCss += ' rotatable' + (forcePrevIcon || self.hideThumbnailContent ? ' hide-rotate' : '');
4452+
isIconic = forcePrevIcon || self.hideThumbnailContent || !!self.previewFileIconSettings[ext];
4453+
addFrameCss += ' rotatable' + (isIconic ? ' hide-rotate' : '');
44524454
}
44534455
prevContent = getContent((forcePrevIcon ? 'other' : cat), data, false, addFrameCss, zoomData);
44544456
return prevContent.setTokens({zoomCache: zoomContent});
@@ -6340,6 +6342,7 @@
63406342
previewContentTemplates: {},
63416343
preferIconicPreview: false,
63426344
preferIconicZoomPreview: false,
6345+
alwaysPreviewFileExtensions: [],
63436346
rotatableFileExtensions: ['jpg', 'jpeg', 'png', 'gif'],
63446347
allowedFileTypes: null,
63456348
allowedFileExtensions: null,
@@ -6397,7 +6400,7 @@
63976400
maxThreads: 4,
63986401
maxRetries: 3,
63996402
showErrorLog: true,
6400-
retainErrorHistory: true, // display complete error history always unless user explicitly resets upload
6403+
retainErrorHistory: false, // when set to true, display complete error history always unless user explicitly resets upload
64016404
skipErrorsAndProceed: false // when set to true, files with errors will be skipped and upload will continue with other files
64026405
},
64036406
uploadExtraData: {},

js/fileinput.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)