• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

AutoInlineUploader - detect when upload has completed

Jake B.

Well-known member
#1
I'm wanting to use the AutoInlineUploader class for a project we are working on in the AdminCP, but I need to detect when the upload is completed so I can close the modal. Is there any way we can get this done without rewriting the AutoInlineUploader javascript?
 

Chris D

XenForo developer
Staff member
#2
You'll see in the code that an event is triggered in the code: "AutoInlineUploadComplete".

Therefore:

Code:
$form.on('AutoInlineUploadComplete', function()
{
    // Do something                                
});
That code would help you do something when that event is triggered.
 

Jake B.

Well-known member
#3
You'll see in the code that an event is triggered in the code: "AutoInlineUploadComplete".

Therefore:

Code:
$form.on('AutoInlineUploadComplete', function()
{
    // Do something                              
});
That code would help you do something when that event is triggered.
I've tried this with no luck. I'm absolutely terrible with JavaScript. How would I go about getting the $form object from outside xenforo.js?

Edit: Nevermind, I've gotten it figured out. Works great, thanks!
 
Last edited:

Chris D

XenForo developer
Staff member
#4
It's just the form.

Code:
$form = $('form.AutoInlineUploader');
You might already have it in your code or there might be a better way but that's the basic gist.