Skip to content

Commit 1f69808

Browse files
committed
Release v2.4.0
1 parent 810e41a commit 1f69808

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
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.3.2",
3+
"version": "2.4.0",
44
"ignore": [
55
"**/.*",
66
"test",

dist/ng-flow-standalone.js

Lines changed: 12 additions & 5 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
@@ -1596,7 +1602,8 @@ angular.module('flow.btn', ['flow.init'])
15961602
'link': function(scope, element, attrs) {
15971603
var isDirectory = attrs.hasOwnProperty('flowDirectory');
15981604
var isSingleFile = attrs.hasOwnProperty('flowSingleFile');
1599-
scope.$flow.assignBrowse(element, isDirectory, isSingleFile);
1605+
var inputAttrs = attrs.hasOwnProperty('flowAttrs') && scope.$eval(attrs.flowAttrs);
1606+
scope.$flow.assignBrowse(element, isDirectory, isSingleFile, inputAttrs);
16001607
}
16011608
};
16021609
}]);

dist/ng-flow-standalone.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ng-flow.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ angular.module('flow.btn', ['flow.init'])
104104
'link': function(scope, element, attrs) {
105105
var isDirectory = attrs.hasOwnProperty('flowDirectory');
106106
var isSingleFile = attrs.hasOwnProperty('flowSingleFile');
107-
scope.$flow.assignBrowse(element, isDirectory, isSingleFile);
107+
var inputAttrs = attrs.hasOwnProperty('flowAttrs') && scope.$eval(attrs.flowAttrs);
108+
scope.$flow.assignBrowse(element, isDirectory, isSingleFile, inputAttrs);
108109
}
109110
};
110111
}]);

dist/ng-flow.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.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.3.2",
3+
"version": "2.4.0",
44
"description": "Flow.js html5 file upload extension on angular.js framework",
55
"scripts": {
66
"test": "grunt test"

0 commit comments

Comments
 (0)