Browse Source

Fix #382: Better implementation for parsing text in `parseError` method.

Kartik Visweswaran 9 years ago
parent
commit
8683ea004c
5 changed files with 21 additions and 9 deletions
  1. 2 1
      CHANGE.md
  2. 8 6
      css/fileinput.css
  3. 0 0
      css/fileinput.min.css
  4. 11 2
      js/fileinput.js
  5. 0 0
      js/fileinput.min.js

+ 2 - 1
CHANGE.md

@@ -12,7 +12,8 @@ Change Log: `bootstrap-fileinput`
 5. (enh #379): Combine more translatable settings and update locale js files.
 6. (enh #380, #381): Consistent styling for thumbnails.
 7. Update translations to include `fileActionSettings`.
-8. (enh #385): Updated Russian & Ukranian translations.
+8. (enh #382): Better implementation for parsing text in `parseError` method.
+9. (enh #385): Updated Russian & Ukranian translations.
 
 ## version 4.2.5
 

+ 8 - 6
css/fileinput.css

@@ -103,10 +103,6 @@
     opacity: 1;
 }
 
-.file-input .btn[disabled], .file-input .btn .disabled {
-    cursor: not-allowed;
-}
-
 .file-preview {
     border-radius: 5px;
     border: 1px solid #ddd;
@@ -198,11 +194,13 @@
 .file-upload-indicator {
     padding-top: 2px;
     cursor: default;
+    opacity: 0.8;
+    width: 60%;
 }
 
 .file-upload-indicator:hover {
     font-weight: bold;
-    padding-top: 0;
+    opacity: 1;
 }
 
 .file-footer-caption {
@@ -219,7 +217,7 @@
 }
 
 .file-footer-caption:hover {
-    color: #333;
+    color: #000;
 }
 
 .file-drop-zone {
@@ -248,4 +246,8 @@
     background-position: center bottom 10px;
     background-repeat: no-repeat;
     opacity: 0.6;
+}
+
+.file-input .btn[disabled], .file-input .btn .disabled, .file-input .btn[disabled] *, .file-input .btn .disabled * {
+    cursor: not-allowed;
 }

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


+ 11 - 2
js/fileinput.js

@@ -478,7 +478,16 @@
         init: function (options) {
             var self = this, $el = self.$element, t;
             $.each(options, function (key, value) {
-                self[key] = (key === 'maxFileCount' || key === 'maxFileSize') ? getNum(value) : value;
+                switch (key) {
+                    case 'minFileCount':
+                    case 'maxFileCount':
+                    case 'maxFileSize':
+                        self[key] = getNum(value);
+                        break;
+                    default:
+                        self[key] = value;
+                        break;
+                }
             });
             self.fileInputCleared = false;
             self.fileBatchCompleted = true;
@@ -541,7 +550,7 @@
                 dot = errMsg.slice(-1) === '.' ? '' : '.',
                 text = jqXHR.responseJSON !== undefined && jqXHR.responseJSON.error !== undefined ?
                     jqXHR.responseJSON.error : jqXHR.responseText;
-            if (self.showAjaxErrorDetails) {
+            if (self.showAjaxErrorDetails && text) {
                 text = $.trim(text.replace(/\n\s*\n/g, '\n'));
                 text = text.length > 0 ? '<pre>' + text + '</pre>' : '';
                 errMsg += dot + text;

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


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