Is it possible to auto-close (hide) modal box after downloading?

Viewing 9 posts - 1 through 9 (of 9 total)
#113380

Hello! I wonder is there a way to auto close modal pop-up after successful download? Maybe somebody knows? Thank you!

#113468

Shahriar
Moderator

Make a custom template for /download-manager/tpls/lock-options/email-lock-form.php and add the following code after line 78. That should close the modal after submitting the email.

setTimeout(function () {
    window.parent.hideLockFrame();
}, 1000);

Template file documentation https://www.wpdownloadmanager.com/doc/template-files/ Basically, copy the file and place it in /active-theme/download-manager/lock-options/email-lock-form.php. Then make the necessary changes.

#113525

Hello! Thank you for the reply!
However, this didn’t work for me. I ended up editing lock-options-iframe.php by adding:
setTimeout(function () {
jQuery(‘#wpdm-locks’).modal(‘hide’);
}, 20000);
This code closes modal pop up after 20sec – enough to enter password and download a file I think. It’s not ideal, but works as a temporary fix.

I probably wasn’t clear enough with my first question, so I’m going to rephrase it: Is it possible to auto-hide modal box not by “timer”. but after a password was entered and “submit” was clicked? This would close this issue for good. Big thanks in advance!

#113703

Shahriar
Moderator

Please send temporary wp-admin login info in private reply. Also, send the package URL. I will test the code there and will let you know the update.

#113715
This reply has been marked as private.
#113716
This reply has been marked as private.
#113730

Shahriar
Moderator

Hi,

Sorry, I overlooked the fact that you are using the Free version. The suggested code will work with the Pro version only. Free version doesn’t have the template I mentioned before.

Anyway, in the free version, you have to edit the /download-manager/libs/class.PackageLocks.php file to close the modal after verifying the password.

Add this code jQuery("#wpdm-locks").modal("hide"); at the position pointed on the scrrenshot.

https://www.evernote.com/l/AUfstaAecqNFK7kJlR_Vi2-OQ-s102qNjLIB/image.png

Thanks.

#113731

Big thank you Shahriar! This totally worked! This topic can now be closed as solved. Again thank you very much!

#113742

Shahriar
Moderator

If you can manage some free time, please add a 5* review here https://wordpress.org/support/view/plugin-reviews/download-manager?rate=5#postform , that will inspire us a lot. Thanks ๐Ÿ™‚

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Is it possible to auto-close (hide) modal box after downloading?’ is closed to new replies.