I have a modal of bootstrap
that I use to register / login cadastroModal
, but at the end of the request, I am reusing it to request the login and for this I added an event in onHiden
, but I can not remove it after the call, so that it reopens the order completion screen.
If the user clicks to close the request and cancels the login screen, if he logs in normally he continues to fire the event
Event Association
self.closeOrder = function () {
if (!self.hasLoggedUser()) {
$('#carrinhoModal').modal('hide');
$('#cadastroModal').modal('show');
$('#cadastroModal').on('hidden.bs.modal', function (e) {
// retorna ao comportamento anterior, só precisávamos agora
$('#cadastroModal').on('hidden.bs.modal', function (e) {});
if (self.hasLoggedUser()) {
$('#pedidoModal').modal('show');
}
})
} else {
$('#pedidoModal').modal('show');
}
}
Attempts:
$('#cadastroModal').on('hidden.bs.modal', null);
$('#cadastroModal').on('hidden.bs.modal', undefined);