Selaa lähdekoodia

Updates to release v4.3.2 fixes #666 fixes #674

Kartik Visweswaran 9 vuotta sitten
vanhempi
commit
1d23766dbb
6 muutettua tiedostoa jossa 15 lisäystä ja 11 poistoa
  1. 2 0
      CHANGE.md
  2. 1 1
      README.md
  3. 12 10
      js/fileinput.js
  4. 0 0
      js/fileinput.min.js
  5. 0 0
      themes/fa/fa.js
  6. 0 0
      themes/gly/gly.js

+ 2 - 0
CHANGE.md

@@ -68,6 +68,8 @@ Change Log: `bootstrap-fileinput`
 19. Enhancements to file preview icons (`other` template).
 20. (enh #654): Update Spanish Translations.
 21. (enh #655): Include sass styling configuration.
+22. (enh #666): Update sortable draggable selector.
+23. (enh #674): Organize all themes in a separate `themes` folder.
 
 ## version 4.3.1
 

+ 1 - 1
README.md

@@ -73,7 +73,7 @@ Step 1: Load the following assets in your header.
 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script>
 <!-- optionally if you need a theme like font awesome theme you can include 
     it as mentioned below -->
-<script src="path/to/js/themes/fa.js"></script>
+<script src="path/to/themes/fa/fa.js"></script>
 <!-- optionally if you need translation for your language then include 
     locale file as mentioned below -->
 <script src="path/to/js/locales/<lang>.js"></script>

+ 12 - 10
js/fileinput.js

@@ -94,10 +94,10 @@
                 template: obj.previewGenericTemplate,
                 showZoom: obj.fileActionSettings.showZoom,
                 showDrag: obj.fileActionSettings.showDrag,
-                getSize: function(size) {
+                getSize: function (size) {
                     return obj._getSize(size);
                 },
-                parseTemplate: function (cat, data, fname, ftype, pId, ftr, ind, size) {
+                parseTemplate: function (cat, data, fname, ftype, pId, ftr, ind) {
                     var fc = ' file-preview-initial';
                     return obj._generatePreviewTemplate(cat, data, fname, ftype, pId, false, null, fc, ftr, ind);
                 },
@@ -842,7 +842,7 @@
             return 'other';
         },
         _parseFilePreviewIcon: function (content, fname) {
-            var self = this, ext, icn = self.previewFileIcon;
+            var self = this, proceed, ext, icn = self.previewFileIcon;
             if (fname && fname.indexOf('.') > -1) {
                 ext = fname.split('.').pop();
                 if (self.previewFileIconSettings && self.previewFileIconSettings[ext]) {
@@ -854,6 +854,7 @@
                             icn = self.previewFileIconSettings[key];
                             return;
                         }
+                        proceed = true;
                     });
                 }
             }
@@ -1036,6 +1037,7 @@
             settings = {
                 handle: '.drag-handle-init',
                 dataIdAttr: 'data-preview-id',
+                draggable: '.file-preview-initial',
                 onSort: function (e) {
                     var oldIndex = e.oldIndex, newIndex = e.newIndex;
                     self.initialPreview = moveArray(self.initialPreview, oldIndex, newIndex);
@@ -1990,10 +1992,10 @@
                                 }
                             });
                         }
-                        var filestack = self.getFileStack(true), len = filestack.length, chk = previewCache.count(
-                            self.id),
-                            hasThumb = self.showPreview && self.$preview.find('.file-preview-frame').length;
                         self._clearFileInput();
+                        var filestack = self.getFileStack(true), chk = previewCache.count(self.id),
+                            len = filestack.length,
+                            hasThumb = self.showPreview && self.$preview.find('.file-preview-frame').length;
                         if (len === 0 && chk === 0 && !hasThumb) {
                             self.reset();
                         } else {
@@ -2029,15 +2031,15 @@
             if (bytes === null || isNaN(size)) {
                 return '';
             }
-            var self = this, i, tmplt = self._getLayoutTemplate('size'), func = self.fileSizeGetter, sizes, out;
+            var self = this, i, func = self.fileSizeGetter, sizes, out;
             if (typeof func === 'function') {
                 out = func(bytes);
             } else {
                 i = Math.floor(Math.log(size) / Math.log(1024));
-                sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
-                    out = (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + sizes[i];
+                sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
+                out = (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + sizes[i];
             }
-            return tmplt.replace('{sizeText}', out);
+            return self._getLayoutTemplate('size').replace('{sizeText}', out);
         },
         _generatePreviewTemplate: function (cat, data, fname, ftype, previewId, isError, size, frameClass, foot, ind) {
             var self = this, tmplt = self._getPreviewTemplate(cat), content, sText, css = frameClass || '',

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
js/fileinput.min.js


+ 0 - 0
js/themes/fa.js → themes/fa/fa.js


+ 0 - 0
js/themes/gly.js → themes/gly/gly.js


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä