the hide.bs.modal event fires even when the modal is already hidden, the
hidden event only fires if the modal was visible and has just become
invisible.