TnT
Active member
- Affected version
- 2.3.0 Beta 2
I am in the process of rewriting one of my addons, as jquery is no longer used. A modal should be displayed as soon as attachments are uploaded to a post. Sending the form with the message should be prevented until the modal dialog is confirmed with "ok". 
And this is exactly where my problem lies. I can no longer prevent the form from being sent.
I have looked at this area (row 145) in the Attachment Manager (/js/xf/attachment_manager.js):
	
	
	
		
Here, for example, the form should be prevented from being sent while files are still being uploaded.
If I comment out the if query here, for example, the form should generally be prevented from being sent. However, it is sent anyway. Even a data.preventDefault(); did not help.
	
	
	
		
				
			And this is exactly where my problem lies. I can no longer prevent the form from being sent.
I have looked at this area (row 145) in the Attachment Manager (/js/xf/attachment_manager.js):
		JavaScript:
	
	                XF.on(this.form, 'ajax-submit:before', data =>
                {
                    if (this.isUploading && !confirm(XF.phrase('files_being_uploaded_are_you_sure')))
                    {
                        data.preventSubmit = true
                    }
                })Here, for example, the form should be prevented from being sent while files are still being uploaded.
If I comment out the if query here, for example, the form should generally be prevented from being sent. However, it is sent anyway. Even a data.preventDefault(); did not help.
		JavaScript:
	
	                XF.on(this.form, 'ajax-submit:before', data =>
                {
                    // if (this.isUploading && !confirm(XF.phrase('files_being_uploaded_are_you_sure')))
                    // {
                        data.preventSubmit = true
                        data.preventDefault();
                    // }
                })