The problem I am running into is a race condition. I have some buttons on the modal where only one of them should be a redirect. Another just closes the thing, and a third makes an ajax call and then closes if that call returns true. I am able to do this by changing the .click of those buttons to prevent the default/etc. But this needs to run after the modal has actually fired, or the selectors will not find the button.
Is there a way to verify that the modal has been fully loaded before some code runs? Or is there a better way to get this desired functionality?