I have a function that is bound to the action of hiding a modal dialog.
I'm using code similar to the accepted answer to this question.
$('#myModal').on('hidden', function () {
// do something…
})
However, this dialog may get reopened for editing, and, when that happens, I don't necessarily want to run this code. Is there a way to "unbind" the function so that it is no longer run when the dialog closes? I haven't found anything in the documentation.