Skip to content

Commit

Permalink
Fix #1449: Lock file input while files are being read for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Aug 23, 2019
1 parent f077a98 commit 18cb677
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ Change Log: `bootstrap-fileinput`

## version 5.0.5

**Date:** _under development_
**Date:** 23-Aug-2019

- (enh #1450): Update Russian Translations.
- (enh #1449): Lock file input while files are being read for preview.
- (enh #1446): New property `showConsoleLogs` to control display of plugin console messages.
- (enh #1445): Correct invalid thumb frame log errors.
- (enh #1442): Implement `.npmignore` to clean unwanted files for NPM package.
Expand Down
8 changes: 5 additions & 3 deletions js/fileinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4788,10 +4788,12 @@
} else {
self._raise('filebatchselected', [files]);
}
self.unlock();
$container.removeClass('file-thumb-loading');
$status.html('');
return;
}
self.lock(true);
var node = ctr + i, previewId = previewInitId + '-' + node, file = files[i], fSizeKB, j, msg,
fnText = settings.text, fnImage = settings.image, fnHtml = settings.html, typ, chk, typ1, typ2,
caption = self._getFileName(file, ''), fileSize = (file && file.size || 0) / 1000,
Expand Down Expand Up @@ -4987,15 +4989,15 @@
readFile(0);
self._updateFileDetails(numFiles, false);
},
lock: function () {
lock: function (selectMode) {
var self = this, $container = self.$container;
self._resetErrors();
self.disable();
$container.addClass('is-locked');
if (self.showCancel) {
if (!selectMode && self.showCancel) {
$container.find('.fileinput-cancel').show();
}
if (self.showPause) {
if (!selectMode && self.showPause) {
$container.find('.fileinput-pause').show();
}
self._raise('filelock', [self.fileManager.stack, self._getExtraData()]);
Expand Down
Loading

0 comments on commit 18cb677

Please sign in to comment.