Просмотр исходного кода

Fix #1215: Correct zoom preview for errored thumbnails

Kartik Visweswaran 7 лет назад
Родитель
Сommit
a67db19c84
3 измененных файлов с 7 добавлено и 4 удалено
  1. 1 0
      CHANGE.md
  2. 6 4
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
 
 
 **Date:** _work in progress_
 **Date:** _work in progress_
 
 
+- (bug #1215): Correct zoom preview for errored thumbnails.
 - (enh #1210): Enhance support for Office Docs Preview and Google Docs Preview.
 - (enh #1210): Enhance support for Office Docs Preview and Google Docs Preview.
 - (bug #1204): Correct merging of ajax callbacks.
 - (bug #1204): Correct merging of ajax callbacks.
 - (bug #1201, #1200): Correct `elErrorContainer` validation for `browseOnZoneClick`.
 - (bug #1201, #1200): Correct `elErrorContainer` validation for `browseOnZoneClick`.

+ 6 - 4
js/fileinput.js

@@ -3542,7 +3542,7 @@
             var self = this, i = 0, newstack = [], newnames = [], newids = [];
             var self = this, i = 0, newstack = [], newnames = [], newids = [];
             self._getThumbs().each(function () {
             self._getThumbs().each(function () {
                 var $thumb = $(this), ind = $thumb.attr('data-fileindex'), file = self.filestack[ind],
                 var $thumb = $(this), ind = $thumb.attr('data-fileindex'), file = self.filestack[ind],
-                    pid = $thumb.attr('id'), newId;
+                    pid = $thumb.attr('id');
                 if (ind === '-1' || ind === -1) {
                 if (ind === '-1' || ind === -1) {
                     return;
                     return;
                 }
                 }
@@ -3553,10 +3553,12 @@
                     $thumb.attr({'id': self.previewInitId + '-' + i, 'data-fileindex': i});
                     $thumb.attr({'id': self.previewInitId + '-' + i, 'data-fileindex': i});
                     i++;
                     i++;
                 } else {
                 } else {
-                    newId = 'uploaded-' + $h.uniqId();
-                    $thumb.attr({'id': newId, 'data-fileindex': '-1'});
-                    self.$preview.find('#zoom-' + pid).attr('id', 'zoom-' + newId);
+                    $thumb.attr({'id': 'uploaded-' + $h.uniqId(), 'data-fileindex': '-1'});
                 }
                 }
+                self.$preview.find('#zoom-' + pid).attr({
+                    'id': 'zoom-' + $thumb.attr('id'),
+                    'data-fileindex': $thumb.attr('data-fileindex')
+                });
             });
             });
             self.filestack = newstack;
             self.filestack = newstack;
             self.filenames = newnames;
             self.filenames = newnames;

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
js/fileinput.min.js


Некоторые файлы не были показаны из-за большого количества измененных файлов