Skip to content

Commit a15c09e

Browse files
committed
Release v2.7.7
1 parent e3b550d commit a15c09e

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ng-flow",
3-
"version": "2.7.6",
3+
"version": "2.7.7",
44
"ignore": [
55
"**/.*",
66
"test",

dist/ng-flow-standalone.js

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@
5757
* Check if directory upload is supported
5858
* @type {boolean}
5959
*/
60-
this.supportDirectory = /Chrome/.test(window.navigator.userAgent);
60+
this.supportDirectory = (
61+
/Chrome/.test(window.navigator.userAgent) ||
62+
/Firefox/.test(window.navigator.userAgent) ||
63+
/Edge/.test(window.navigator.userAgent)
64+
);
6165

6266
/**
6367
* List of FlowFile objects
@@ -97,7 +101,7 @@
97101
initFileFn: null,
98102
readFileFn: webAPIFileRead
99103
};
100-
104+
101105
/**
102106
* Current options
103107
* @type {Object}
@@ -155,7 +159,7 @@
155159
/**
156160
* Set a callback for an event, possible events:
157161
* fileSuccess(file), fileProgress(file), fileAdded(file, event),
158-
* fileRemoved(file), fileRetry(file), fileError(file, message),
162+
* fileRemoved(file), fileRetry(file), fileError(file, message),
159163
* complete(), progress(), error(message, file), pause()
160164
* @function
161165
* @param {string} event
@@ -518,7 +522,9 @@
518522
*/
519523
resume: function () {
520524
each(this.files, function (file) {
521-
file.resume();
525+
if (!file.isComplete()) {
526+
file.resume();
527+
}
522528
});
523529
},
524530

@@ -579,11 +585,13 @@
579585
var files = [];
580586
each(fileList, function (file) {
581587
// https://github.com/flowjs/flow.js/issues/55
582-
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
583-
(this.opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file)))) {
584-
var f = new FlowFile(this, file);
585-
if (this.fire('fileAdded', f, event)) {
586-
files.push(f);
588+
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.'))) {
589+
var uniqueIdentifier = this.generateUniqueIdentifier(file);
590+
if (this.opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(uniqueIdentifier)) {
591+
var f = new FlowFile(this, file, uniqueIdentifier);
592+
if (this.fire('fileAdded', f, event)) {
593+
files.push(f);
594+
}
587595
}
588596
}
589597
}, this);
@@ -691,16 +699,17 @@
691699
* @name FlowFile
692700
* @param {Flow} flowObj
693701
* @param {File} file
702+
* @param {string} uniqueIdentifier
694703
* @constructor
695704
*/
696-
function FlowFile(flowObj, file) {
705+
function FlowFile(flowObj, file, uniqueIdentifier) {
697706

698707
/**
699708
* Reference to parent Flow instance
700709
* @type {Flow}
701710
*/
702711
this.flowObj = flowObj;
703-
712+
704713
/**
705714
* Used to store the bytes read
706715
* @type {Blob|string}
@@ -735,7 +744,7 @@
735744
* File unique identifier
736745
* @type {string}
737746
*/
738-
this.uniqueIdentifier = flowObj.generateUniqueIdentifier(file);
747+
this.uniqueIdentifier = (uniqueIdentifier === undefined ? flowObj.generateUniqueIdentifier(file) : uniqueIdentifier);
739748

740749
/**
741750
* List of chunks
@@ -1482,7 +1491,7 @@
14821491
each(query, function (v, k) {
14831492
data.append(k, v);
14841493
});
1485-
data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
1494+
if (typeof blob !== "undefined") data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
14861495
}
14871496

14881497
this.xhr.open(method, target, true);
@@ -1600,7 +1609,7 @@
16001609
* Library version
16011610
* @type {string}
16021611
*/
1603-
Flow.version = '2.11.2';
1612+
Flow.version = '2.13.0';
16041613

16051614
if ( typeof module === "object" && module && typeof module.exports === "object" ) {
16061615
// Expose Flow as module.exports in loaders that implement the Node

0 commit comments

Comments
 (0)