Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onQueueComplete #7

Open
blacmox opened this issue Dec 19, 2020 · 3 comments
Open

onQueueComplete #7

blacmox opened this issue Dec 19, 2020 · 3 comments

Comments

@blacmox
Copy link

blacmox commented Dec 19, 2020

Hi,

I just migrated from uploadify to uploadifive to get rid of the flash usage, and everything works fine except from the event 'onQueueComplete' :-/

Of course I checked the code intended for the event; it works fine with other events like 'onUploadComplete'. There must be a bug... somewhere.

Regards

@blacmox
Copy link
Author

blacmox commented Dec 20, 2020

Despite rather modest JS knowledge, I found the cause here:

Line 814: if ($('#' + settings.queueID).find('.uploadifive-queue-item').not('.error, .complete').size() === 0)

However, size( ) has been removed in jQuery 3.0, so length must be used.

Cheers

@DarkSide666
Copy link

DarkSide666 commented Sep 25, 2023

That's not exactly the problem. Well it is if you use newer jQuery (see #13) of course, but there is another problem here.

This line 814 is reached BEFORE it calls file.queueItem.addClass('complete'); in line 569, so as result in line 814 it's always selecting all items because they are still not "completed".

Most likely this call of queueComplete() method should be included at the end of uploadComplete() method.
Ugly fix for me was to include these lines at the end of my custom onUploadComplete method:

var $this    = $(this),
    $data    = $this.data("uploadifive"),
    settings = $data.settings;
if ($("#" + settings.queueID).find(".uploadifive-queue-item").not(".error, .complete").size() === 0) {
    $data.queueComplete();
}

@dave-amit
Copy link

For me, it was due to the jquery issue of - size() is not a function. So I added following code before uploadifive code
$(function() { $.fn.size = function() { return this.length; } });
and it worked :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants