I have made a fiddle illustrating the issue I am facing at the moment. So every time I close and open a modal, shown.bs.modal also fires multiple times. In this
The function below is used for all the dialogs in my application.
It gets called each time with a different callback to execute. The easiest solution for me is simply to remove the event handler before adding a new one.
function messageBox(action,...) {
$("#modal-btn-ok").off("click");
$("#modal-btn-ok").on("click", function(e) {
action(e);
});