Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
Calling different functions after hiding a bootstrap modal depending on the button used to hide it

I am using a bootstrap modal in my project. It has a Confirm and a Cancel button. I am using a promisified function to call and hide the modal. It also has a backdrop(which if clicked closes the modal) and a cross(x) button in the modal header which also closes the modal.

I want to resolve the promise and return true if the modal was hidden by the click on the Confirm button and resolve with false if it was closed by either Cancel, backdrop click, or the cross button.

The event (hidden.bs.modal) exposed by Bootstrap doesn't provide the ability to identify the source(button) that was used to hide the modal and hence unable to customize actions for them.

How can I achieve the desired results? Are there any specific class names to pick just the backdrop, cross button? I can add click listeners to them separately maybe. I couldn't find those class names.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda