3
I have a modal from bootstrap
I use to register/login cadastroModal
, but at the end of the order, I’m repurposing it to request the login and for that I added an event on onHiden
, but I can’t remove it after the call, so it opens the order checkout screen again.
If the user clicks to close the order and cancels the login screen, if he logs in normally he continues to trigger 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);
.off http://api.jquery.com/off/
– Diego Vieira