Bladeren bron

Updates to release v4.3.4 fixes #722

Kartik Visweswaran 8 jaren geleden
bovenliggende
commit
470d41689f
4 gewijzigde bestanden met toevoegingen van 18 en 6 verwijderingen
  1. 3 0
      CHANGE.md
  2. 14 6
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js
  4. 1 0
      package.json

+ 3 - 0
CHANGE.md

@@ -7,6 +7,9 @@ Change Log: `bootstrap-fileinput`
 
 1. (bug #710): Fix bug for `ifSet` validation.
 2. Add contribution templates.
+3. (enh #718): Update Japanese Translations.
+4. (enh #721): Update Turkish Translations.
+5. (bug #722): Correctly concat ajax output in initial preview.
 
 ## version 4.3.3
 

+ 14 - 6
js/fileinput.js

@@ -1619,7 +1619,15 @@
             self.ajaxRequests.push($.ajax(settings));
         },
         _initUploadSuccess: function (out, $thumb, allFiles) {
-            var self = this, append, data, index, $newThumb, content, config, tags, i;
+            var self = this, append, data, index, $newThumb, content, config, tags, i,
+                mergeArray = function(prop, content) {
+                    if (!(self[prop] instanceof Array)) {
+                        self[prop] = [];
+                    }
+                    if (content && content.length) {
+                        self[prop] = self[prop].concat(content);
+                    }
+                };
             if (!self.showPreview || typeof out !== 'object' || $.isEmptyObject(out)) {
                 return;
             }
@@ -1633,9 +1641,9 @@
                     content = content.split(self.initialPreviewDelimiter);
                 }
                 self.overwriteInitial = false;
-                self.initialPreview.concat(content);
-                self.initialPreviewThumbTags.concat(tags);
-                self.initialPreviewConfig.concat(config);
+                mergeArray('initialPreview', content);
+                mergeArray('initialPreviewConfig', config);
+                mergeArray('initialPreviewThumbTags', tags);
                 if ($thumb !== undefined) {
                     if (!allFiles) {
                         index = previewCache.add(self.id, content, config[0], tags[0], append);
@@ -1650,8 +1658,8 @@
                     } else {
                         i = $thumb.attr('data-fileindex');
                         self.uploadCache.content[i] = content[0];
-                        self.uploadCache.config[i] = config[0];
-                        self.uploadCache.tags[i] = tags[0];
+                        self.uploadCache.config[i] = config[0] || [];
+                        self.uploadCache.tags[i] = tags[0] || [];
                         self.uploadCache.append = append;
                     }
                 } else {

File diff suppressed because it is too large
+ 0 - 0
js/fileinput.min.js


+ 1 - 0
package.json

@@ -27,6 +27,7 @@
         "gallery"
     ],
     "main": "./js/fileinput.js",
+    "style": "./css/fileinput.css",
     "peerDependencies": {
         "jquery": ">= 1.9.0",
         "bootstrap": "~3"

Some files were not shown because too many files changed in this diff