Check whether modal is open based on value of $modal.