Pārlūkot izejas kodu

Updates to release v4.2.1

Kartik Visweswaran 10 gadi atpakaļ
vecāks
revīzija
c66c2ac8bd
5 mainītis faili ar 9 papildinājumiem un 11 dzēšanām
  1. 2 2
      CHANGE.md
  2. 1 0
      README.md
  3. 1 1
      bower.json
  4. 5 8
      js/fileinput.js
  5. 0 0
      js/fileinput.min.js

+ 2 - 2
CHANGE.md

@@ -1,6 +1,6 @@
 version 4.2.1
 =============
-**Date**: 22-May-2015
+**Date**: 31-May-2015
 
 1. (enh #279, #280): Fixed error for failed response types.
 2. (enh #287): Add Brazilian Portugese (pt-BR) translations.
@@ -15,7 +15,7 @@ version 4.2.1
 7. (enh #302): Add Greek (el) translations.
 8. (enh #303): Validate only files to be dragged and dropped.
 9. (enh #305): Implement better cleanup of memory with `revokeObjectURL`.
-10. (enh #307): Allow setting thumbnail frame style and attributes via `initialPreviewConfig`.
+10. (enh #307): Allow setting thumbnail frame css class and attributes via `initialPreviewConfig`.
 
 version 4.2.0
 =============

+ 1 - 0
README.md

@@ -1492,6 +1492,7 @@ The above abort will be triggered at time of upload for (ajax uploads) OR at for
 ```js
 $('#input').on('filecustomerror', function(event, params) {
    // params.abortData will contain the additional abort data passed
+   // params.abortMessage will contain the aborted error message passed
 });
 ```
 

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "bootstrap-fileinput",
-    "version": "4.2.0",
+    "version": "4.2.1",
     "homepage": "https://github.com/kartik-v/bootstrap-fileinput",
     "authors": [
         "Kartik Visweswaran <[email protected]>"

+ 5 - 8
js/fileinput.js

@@ -570,9 +570,9 @@
                 case 'filecustomerror':
                 case 'filesuccessremove':
                     break;
-                // can trigger filecustomerror to abort upload
+                // receive data response via `filecustomerror` event`
                 default:
-                    self.ajaxAborted = true;
+                    self.ajaxAborted = e.result;
                     break;
             }
             return true;
@@ -663,12 +663,9 @@
         abort: function (params) {
             var self = this, data;
             if (self.ajaxAborted && typeof self.ajaxAborted === "object" && self.ajaxAborted.message !== undefined) {
-                if (self.ajaxAborted.data !== undefined) {
-                    data = self.getOutData({}, self.ajaxAborted.data);
-                } else {
-                    data = self.getOutData();
-                }
-                data = $.extend(data, params);
+                data = $.extend(self.getOutData(), params);
+                data.abortData = self.ajaxAborted.data || {};
+                data.abortMessage = self.ajaxAborted.message;
                 self.showUploadError(self.ajaxAborted.message, data, 'filecustomerror');
                 return true;
             }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
js/fileinput.min.js


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels