Skip to content

Commit 0525b25

Browse files
committed
Release v2.5.0
1 parent 2a7b093 commit 0525b25

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
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": "flow.js",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"main": "./dist/flow.js",
55
"ignore": [
66
"**/.*",

dist/flow.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,12 @@
344344
* @param {Element|Array.<Element>} domNodes
345345
* @param {boolean} isDirectory Pass in true to allow directories to
346346
* @param {boolean} singleFile prevent multi file upload
347+
* @param {Object} attributes set custom attributes:
348+
* http://www.w3.org/TR/html-markup/input.file.html#input.file-attributes
349+
* eg: accept: 'image/*'
347350
* be selected (Chrome only).
348351
*/
349-
assignBrowse: function (domNodes, isDirectory, singleFile) {
352+
assignBrowse: function (domNodes, isDirectory, singleFile, attributes) {
350353
if (typeof domNodes.length === 'undefined') {
351354
domNodes = [domNodes];
352355
}
@@ -379,6 +382,9 @@
379382
if (isDirectory) {
380383
input.setAttribute('webkitdirectory', 'webkitdirectory');
381384
}
385+
each(attributes, function (value, key) {
386+
input.setAttribute(key, value);
387+
});
382388
// When new files are added, simply append them to the overall list
383389
var $ = this;
384390
input.addEventListener('change', function (e) {
@@ -1210,8 +1216,8 @@
12101216
if (typeof preprocess === 'function') {
12111217
switch (this.preprocessState) {
12121218
case 0:
1213-
preprocess(this);
12141219
this.preprocessState = 1;
1220+
preprocess(this);
12151221
return;
12161222
case 1:
12171223
return;
@@ -1367,7 +1373,7 @@
13671373
data.append(this.flowObj.opts.fileParameterName, blob);
13681374
}
13691375

1370-
this.xhr.open(method, target);
1376+
this.xhr.open(method, target, true);
13711377
this.xhr.withCredentials = this.flowObj.opts.withCredentials;
13721378

13731379
// Add data from header options
@@ -1465,7 +1471,7 @@
14651471
* Library version
14661472
* @type {string}
14671473
*/
1468-
Flow.version = '2.4.0';
1474+
Flow.version = '2.5.0';
14691475

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

0 commit comments

Comments
 (0)