Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -419,7 +419,7 @@ |
420 | 420 | newUpload: function( file ) { |
421 | 421 | var _this = this; |
422 | 422 | |
423 | | - if ( _this.uploads.length == _this.maxUploads ) { |
| 423 | + if ( _this.uploads.length >= _this.maxUploads ) { |
424 | 424 | return false; |
425 | 425 | } |
426 | 426 | |
— | — | @@ -450,6 +450,11 @@ |
451 | 451 | */ |
452 | 452 | setUploadFilled: function( upload ) { |
453 | 453 | var _this = this; |
| 454 | + |
| 455 | + if ( _this.uploads.length >= _this.maxUploads ) { |
| 456 | + _this.removeUpload( upload ); |
| 457 | + return false; |
| 458 | + } |
454 | 459 | |
455 | 460 | _this.uploads.push( upload ); |
456 | 461 | |