Skip to content

Commit c3d0fbf

Browse files
committed
Reverted: behavior by default after select file
1 parent 6641094 commit c3d0fbf

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed

angular-file-upload.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
angular-file-upload v1.0.1
2+
angular-file-upload v1.0.2
33
https://github.com/nervgh/angular-file-upload
44
*/
55
(function(angular, factory) {
@@ -10,9 +10,10 @@
1010
} else {
1111
return factory(angular);
1212
}
13-
}(typeof angular === 'undefined' ? null : angular || null, function(angular) {
13+
}(typeof angular === 'undefined' ? null : angular, function(angular) {
1414

1515
var module = angular.module('angularFileUpload', []);
16+
1617
'use strict';
1718

1819
/**
@@ -1048,6 +1049,13 @@ module
10481049
* @return {Array<Function>|String|undefined}
10491050
*/
10501051
FileSelect.prototype.getFilters = function() {};
1052+
/**
1053+
* If returns "true" then HTMLInputElement will be cleared
1054+
* @returns {Boolean}
1055+
*/
1056+
FileSelect.prototype.isEmptyAfterSelection = function() {
1057+
return !!this.element.attr('multiple');
1058+
};
10511059
/**
10521060
* Event handler
10531061
*/
@@ -1058,7 +1066,7 @@ module
10581066

10591067
if (!this.uploader.isHTML5) this.destroy();
10601068
this.uploader.addToQueue(files, options, filters);
1061-
if (this.uploader.isHTML5) this.element.prop('value', null);
1069+
if (this.isEmptyAfterSelection()) this.element.prop('value', null);
10621070
};
10631071

10641072
// ---------------------------

angular-file-upload.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.

angular-file-upload.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-upload",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"main": "angular-file-upload.js",
55
"homepage": "https://github.com/nervgh/angular-file-upload",
66
"ignore": ["examples"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-upload",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"homepage": "https://github.com/nervgh/angular-file-upload",
55
"description": "Angular File Upload is a module for the AngularJS framework",
66
"author": {

src/module.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,13 @@ module
10331033
* @return {Array<Function>|String|undefined}
10341034
*/
10351035
FileSelect.prototype.getFilters = function() {};
1036+
/**
1037+
* If returns "true" then HTMLInputElement will be cleared
1038+
* @returns {Boolean}
1039+
*/
1040+
FileSelect.prototype.isEmptyAfterSelection = function() {
1041+
return !!this.element.attr('multiple');
1042+
};
10361043
/**
10371044
* Event handler
10381045
*/
@@ -1043,7 +1050,7 @@ module
10431050

10441051
if (!this.uploader.isHTML5) this.destroy();
10451052
this.uploader.addToQueue(files, options, filters);
1046-
if (this.uploader.isHTML5) this.element.prop('value', null);
1053+
if (this.isEmptyAfterSelection()) this.element.prop('value', null);
10471054
};
10481055

10491056
// ---------------------------

0 commit comments

Comments
 (0)