Skip to content

Commit

Permalink
Release v2.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
AidasK committed Jun 20, 2017
1 parent e3b550d commit a15c09e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-flow",
"version": "2.7.6",
"version": "2.7.7",
"ignore": [
"**/.*",
"test",
Expand Down
37 changes: 23 additions & 14 deletions dist/ng-flow-standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
* Check if directory upload is supported
* @type {boolean}
*/
this.supportDirectory = /Chrome/.test(window.navigator.userAgent);
this.supportDirectory = (
/Chrome/.test(window.navigator.userAgent) ||
/Firefox/.test(window.navigator.userAgent) ||
/Edge/.test(window.navigator.userAgent)
);

/**
* List of FlowFile objects
Expand Down Expand Up @@ -97,7 +101,7 @@
initFileFn: null,
readFileFn: webAPIFileRead
};

/**
* Current options
* @type {Object}
Expand Down Expand Up @@ -155,7 +159,7 @@
/**
* Set a callback for an event, possible events:
* fileSuccess(file), fileProgress(file), fileAdded(file, event),
* fileRemoved(file), fileRetry(file), fileError(file, message),
* fileRemoved(file), fileRetry(file), fileError(file, message),
* complete(), progress(), error(message, file), pause()
* @function
* @param {string} event
Expand Down Expand Up @@ -518,7 +522,9 @@
*/
resume: function () {
each(this.files, function (file) {
file.resume();
if (!file.isComplete()) {
file.resume();
}
});
},

Expand Down Expand Up @@ -579,11 +585,13 @@
var files = [];
each(fileList, function (file) {
// https://github.com/flowjs/flow.js/issues/55
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
(this.opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file)))) {
var f = new FlowFile(this, file);
if (this.fire('fileAdded', f, event)) {
files.push(f);
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.'))) {
var uniqueIdentifier = this.generateUniqueIdentifier(file);
if (this.opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(uniqueIdentifier)) {
var f = new FlowFile(this, file, uniqueIdentifier);
if (this.fire('fileAdded', f, event)) {
files.push(f);
}
}
}
}, this);
Expand Down Expand Up @@ -691,16 +699,17 @@
* @name FlowFile
* @param {Flow} flowObj
* @param {File} file
* @param {string} uniqueIdentifier
* @constructor
*/
function FlowFile(flowObj, file) {
function FlowFile(flowObj, file, uniqueIdentifier) {

/**
* Reference to parent Flow instance
* @type {Flow}
*/
this.flowObj = flowObj;

/**
* Used to store the bytes read
* @type {Blob|string}
Expand Down Expand Up @@ -735,7 +744,7 @@
* File unique identifier
* @type {string}
*/
this.uniqueIdentifier = flowObj.generateUniqueIdentifier(file);
this.uniqueIdentifier = (uniqueIdentifier === undefined ? flowObj.generateUniqueIdentifier(file) : uniqueIdentifier);

/**
* List of chunks
Expand Down Expand Up @@ -1482,7 +1491,7 @@
each(query, function (v, k) {
data.append(k, v);
});
data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
if (typeof blob !== "undefined") data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
}

this.xhr.open(method, target, true);
Expand Down Expand Up @@ -1600,7 +1609,7 @@
* Library version
* @type {string}
*/
Flow.version = '2.11.2';
Flow.version = '2.13.0';

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

0 comments on commit a15c09e

Please sign in to comment.