I am using a bootstrap modal in my project. It has a Confirm and a Cancel button. I am using a promisified function to call and hide the modal. It also has a backdrop(which if clicked closes the modal) and a cross(x) button in the modal header which also closes the modal.
I want to resolve the promise and return true if the modal was hidden by the click on the Confirm button and resolve with false if it was closed by either Cancel, backdrop click, or the cross button.
The event (hidden.bs.modal) exposed by Bootstrap doesn't provide the ability to identify the source(button) that was used to hide the modal and hence unable to customize actions for them.
How can I achieve the desired results? Are there any specific class names to pick just the backdrop, cross button? I can add click listeners to them separately maybe. I couldn't find those class names.