I want to add functionality of auto-destroying dialog on close without adding any special code to every dialog call in the current project. So I think it needs to override the default dialog close
event.
I found a way to do this (for example: How to extend a jquery ui widget ? (1.7)), but I don't want just override the event: I also need to save the previous behavior of the event and add $(this).dialog("destroy")
call after it.
Any suggestions?