File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1873,6 +1873,7 @@ plupload.Uploader = function(options) {
1873
1873
addFile : function ( file , fileName ) {
1874
1874
var self = this
1875
1875
, queue = [ ]
1876
+ , filesAdded = [ ]
1876
1877
, ruid
1877
1878
;
1878
1879
@@ -1924,7 +1925,11 @@ plupload.Uploader = function(options) {
1924
1925
// run through the internal and user-defined filters, if any
1925
1926
filterFile ( file , function ( err ) {
1926
1927
if ( ! err ) {
1928
+ // make files available for the filters by updating the main queue directly
1927
1929
files . push ( file ) ;
1930
+ // collect the files that will be passed to FilesAdded event
1931
+ filesAdded . push ( file ) ;
1932
+
1928
1933
self . trigger ( "FileFiltered" , file ) ;
1929
1934
}
1930
1935
delay ( cb , 1 ) ; // do not build up recursions or eventually we might hit the limits
@@ -1954,8 +1959,8 @@ plupload.Uploader = function(options) {
1954
1959
if ( queue . length ) {
1955
1960
o . inSeries ( queue , function ( ) {
1956
1961
// if any files left after filtration, trigger FilesAdded
1957
- if ( files . length ) {
1958
- self . trigger ( "FilesAdded" , files ) ;
1962
+ if ( filesAdded . length ) {
1963
+ self . trigger ( "FilesAdded" , filesAdded ) ;
1959
1964
}
1960
1965
} ) ;
1961
1966
}
You can’t perform that action at this time.
0 commit comments