I have a metabox file upload field which has a problem that if you submit the form while the files are being uploaded, it does not wait for the file upload to be finished, and we end up saving the post without files getting saved.
What I have figured is that if we disable the submit button while the files are being uploaded, then this situation can be taken care of. Until now, I have figured that plupload library is being used by metabox for file upload.
However, when I try to bind the FileUploaded event using this code:
this event does not fire at all. Could you please point me in the right direction on how can I correctly bind the events to the file upload field. Or how can I disable the form submit while the files are being uploaded.
I will inform the development team to fix this issue in future updates. For now, I think you can use the JS code to check the class rwmb-media-list, if it has the child class rwmb-file, then enable the submit button. If not, just disable the submit button.