Open paradigmbase opened 10 years ago
For the cancel all handler, a while loop works better then using each.
backbone.upload-manager.js ln 198:
// Add cancel all handler
$('button#cancel-uploads-button', this.el).click(function(){
while (self.files.length) {
self.files.at(0).cancel();
}
});
@paradigmbase Nice solution. Thx a lot!
Np
Doesn't look like this solution ever got merged in. The bug persists on the demo page. I will setup a PR for this.
@paradigmbase Your code snippet seams to always loop on the first item, as the cancel
method on file don't remove it from files collection... Right ?
It essentially does the same thing as your original code, except that instead of using each it uses a while loop. The each loop didn't allow the cancel method to be called on each model in the collection, but a while loop does.
It does call cancel on the first item of the collection. However, each time the loop iterates this is a new item since the previous first item has been removed.
In my app as well as the demo page, clicking on Cancel Uploads only removes half of the files in the queue.