Disable minimizing in upload widget
Hello!
Our team would like to disable the option to minimize the upload widget.
Is there an option to do this?
Alternatively, is there a command like `widget.maximize` or something to UN minimize the widget? (I know that widget.minimize exists)
-
Hi Nick,
Thanks for reaching out, and sorry for the delayed response.
To provide a quick answer, it's not currently possible to prevent the minimization of the upload while an upload is taking place - there is no configuration option that hides the button.
However, there are other options that can work for you, depending on your exact requirements, and especially if you're making use of the widget's events: https://cloudinary.com/documentation/upload_widget#api_events
Firstly, the minimize button is only present when the widget is opened as a modal dialog - if you can add the widget to a specific container it will not show that button. You could implement your own modal, then add the widget to it, then dismiss it or allow it to be dismissed when the upload completes. The demo widget works like this: https://demo.cloudinary.com/uw/#/
Secondly, the widget sends API events when it minimizes, and we expose both the current status ( widget.isMinimized ) and a method to minimize or expand it as you need - here's an example that uses that to send an error to the user: https://jsfiddle.net/stephencloudinary/ywtbaqo4/ (though it's not possible to re-expand the widget programmatically, so the user must click the link)
Thirdly, you can use the events to know when the file upload completes, and use that information to populate your form and the associated validation code, so even if a user minimizes or closes the widget, they can't complete the form until the file upload is successful.
Hope this helps, please let me know if you have any further questions.
Best regards,
Tamara0
Post is closed for comments.
Comments
1 comment