Add custom events `plainmodalbeforeopen` and `plainmodalbeforeclose`