Procházet zdrojové kódy

Correct success file thumbs init fix #1647 fix #1679 fix #1695

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

+ 1 - 0
CHANGE.md

@@ -7,6 +7,7 @@ Change Log: `bootstrap-fileinput`
 
 
 - (enh #1693): Add Latvian Translations.
 - (enh #1693): Add Latvian Translations.
 - (enh #1690): Add Uzbek Cyrillic Translations.
 - (enh #1690): Add Uzbek Cyrillic Translations.
+- (enh #1647, #1679, #1695): Correct success file thumbs init.
 
 
 ## version 5.1.5
 ## version 5.1.5
 
 

+ 17 - 15
js/fileinput.js

@@ -3446,24 +3446,26 @@
             if (!self.showPreview) {
             if (!self.showPreview) {
                 return;
                 return;
             }
             }
-            self._getThumbs($h.FRAMES + '.file-preview-success').each(function () {
-                var $thumb = $(this), $remove = $thumb.find('.kv-file-remove');
-                $remove.removeAttr('disabled');
-                self._handler($remove, 'click', function () {
-                    var id = $thumb.attr('id'),
-                        out = self._raise('filesuccessremove', [id, $thumb.attr('data-fileindex')]);
-                    $h.cleanMemory($thumb);
-                    if (out === false) {
-                        return;
-                    }
-                    $thumb.fadeOut('slow', function () {
-                        $thumb.remove();
-                        if (!self.getFrames().length) {
-                            self.reset();
+            setTimeout(function() {
+                self._getThumbs($h.FRAMES + '.file-preview-success').each(function () {
+                    var $thumb = $(this), $remove = $thumb.find('.kv-file-remove');
+                    $remove.removeAttr('disabled');
+                    self._handler($remove, 'click', function () {
+                        var id = $thumb.attr('id'),
+                            out = self._raise('filesuccessremove', [id, $thumb.attr('data-fileindex')]);
+                        $h.cleanMemory($thumb);
+                        if (out === false) {
+                            return;
                         }
                         }
+                        $thumb.fadeOut('slow', function () {
+                            $thumb.remove();
+                            if (!self.getFrames().length) {
+                                self.reset();
+                            }
+                        });
                     });
                     });
                 });
                 });
-            });
+            }, self.processDelay);
         },
         },
         _updateInitialPreview: function () {
         _updateInitialPreview: function () {
             var self = this, u = self.uploadCache;
             var self = this, u = self.uploadCache;

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ů