File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1885,6 +1885,7 @@ plupload.Uploader = function(options) {
1885
1885
addFile : function ( file , fileName ) {
1886
1886
var self = this
1887
1887
, queue = [ ]
1888
+ , filesAdded = [ ]
1888
1889
, ruid
1889
1890
;
1890
1891
@@ -1936,7 +1937,11 @@ plupload.Uploader = function(options) {
1936
1937
// run through the internal and user-defined filters, if any
1937
1938
filterFile ( file , function ( err ) {
1938
1939
if ( ! err ) {
1940
+ // make files available for the filters by updating the main queue directly
1939
1941
files . push ( file ) ;
1942
+ // collect the files that will be passed to FilesAdded event
1943
+ filesAdded . push ( file ) ;
1944
+
1940
1945
self . trigger ( "FileFiltered" , file ) ;
1941
1946
}
1942
1947
delay ( cb , 1 ) ; // do not build up recursions or eventually we might hit the limits
@@ -1966,8 +1971,8 @@ plupload.Uploader = function(options) {
1966
1971
if ( queue . length ) {
1967
1972
o . inSeries ( queue , function ( ) {
1968
1973
// if any files left after filtration, trigger FilesAdded
1969
- if ( files . length ) {
1970
- self . trigger ( "FilesAdded" , files ) ;
1974
+ if ( filesAdded . length ) {
1975
+ self . trigger ( "FilesAdded" , filesAdded ) ;
1971
1976
}
1972
1977
} ) ;
1973
1978
}
You can’t perform that action at this time.
0 commit comments