Skip to content

Commit 2d73dc5

Browse files
committed
#289 Implementation of async filters
1 parent cd977cc commit 2d73dc5

File tree

12 files changed

+293
-94
lines changed

12 files changed

+293
-94
lines changed

dist/angular-file-upload.js

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

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

dist/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.

dist/angular-file-upload.min.js.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.

examples/image-preview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
1515

1616
<!--<script src="../bower_components/angular/angular.js"></script>-->
17-
<script src="http://code.angularjs.org/1.1.5/angular.min.js"></script>
17+
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
1818
<script src="../../dist/angular-file-upload.min.js"></script>
1919
<script src="controllers.js"></script>
2020

examples/simple/controllers.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,24 @@ angular
1313
});
1414

1515
// FILTERS
16-
16+
17+
// a sync filter
1718
uploader.filters.push({
18-
name: 'customFilter',
19+
name: 'syncFilter',
1920
fn: function(item /*{File|FileLikeObject}*/, options) {
21+
console.log('syncFilter');
2022
return this.queue.length < 10;
2123
}
2224
});
25+
26+
// an async filter
27+
uploader.filters.push({
28+
name: 'asyncFilter',
29+
fn: function(item /*{File|FileLikeObject}*/, options, deferred) {
30+
console.log('asyncFilter');
31+
setTimeout(deferred.resolve, 1e3);
32+
}
33+
});
2334

2435
// CALLBACKS
2536

examples/simple/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
1515

1616
<!--<script src="../bower_components/angular/angular.js"></script>-->
17-
<script src="http://code.angularjs.org/1.1.5/angular.min.js"></script>
17+
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
1818
<script src="../../dist/angular-file-upload.min.js"></script>
1919
<script src="controllers.js"></script>
2020

examples/without-bootstrap/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<!--<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>-->
1111
<script src="../console-sham.js"></script>
1212

13-
<script src="http://code.angularjs.org/1.1.5/angular.min.js"></script>
13+
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
1414
<script src="../../dist/angular-file-upload.min.js"></script>
1515
<script src="controllers.js"></script>
1616

0 commit comments

Comments
 (0)