Selaa lähdekoodia

Updates to release v5.0.5 fix #1445 fix #1446

Kartik Visweswaran 5 vuotta sitten
vanhempi
commit
b2e1557eb5
3 muutettua tiedostoa jossa 10 lisäystä ja 4 poistoa
  1. 3 1
      CHANGE.md
  2. 7 3
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 3 - 1
CHANGE.md

@@ -3,8 +3,10 @@ Change Log: `bootstrap-fileinput`
 
 ## version 5.0.5
 
-**Date:** 26-Jul-2019
+**Date:** _under development_
 
+- (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.
 - (enh #1438): Activating Open Collective.
 - (enh #1436): Improve Portuguese translations.

+ 7 - 3
js/fileinput.js

@@ -1719,7 +1719,7 @@
                         a = config ? {title: config.title || null, alt: config.alt || null} : {title: null, alt: null},
                         parseTemplate = function (cat, dat, fname, ftype, ftr, ind, fclass, t) {
                             var fc = ' file-preview-initial ' + $h.SORT_CSS + (fclass ? ' ' + fclass : ''),
-                                id = self.previewInitId + '-' + $h.INIT_FLAG + ind,
+                                id = self.previewInitId + '-' + ind,
                                 fileId = config && config.fileId || id;
                             /** @namespace config.zoomData */
                             return self._generatePreviewTemplate(cat, dat, fname, ftype, id, fileId, false, null, fc,
@@ -1911,14 +1911,17 @@
         },
         _log: function (msg, tokens) {
             var self = this, id = self.$element.attr('id');
+            if (!self.showConsoleLogs) {
+                return;
+            }
             if (id) {
                 msg = '"' + id + '": ' + msg;
             }
             msg = 'bootstrap-fileinput: ' + msg;
             if (typeof tokens === 'object') {
-                msg.setTokens(tokens);
+                msg = msg.setTokens(tokens);
             }
-            if (typeof window.console.log !== 'undefined') {
+            if (window.console && typeof window.console.log !== 'undefined') {
                 window.console.log(msg);
             } else {
                 window.alert(msg);
@@ -5360,6 +5363,7 @@
         showPause: null,
         showClose: true,
         showUploadedThumbs: true,
+        showConsoleLogs: true,
         browseOnZoneClick: false,
         autoReplace: false,
         autoOrientImage: function () { // applicable for JPEG images only and non ios safari

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


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