[#57588044] More work on modals: fixes broken event for close; adds template method for individual classes handling close