ifad / data-confirm-modal

Makes Rails' link_to confirm: 'foo' build a Bootstrap Modal instead of calling the browser's confirm() API.
MIT License
271 stars 115 forks source link

Control the confirmation event, to close the modal only when it succeeds #65

Open lvitals opened 6 years ago

lvitals commented 6 years ago

Hi, How can I control the confirmation event, to close the modal only when it succeeds? Do not have any option to set the backdrop and keyboard?

ex. $('#myModal').modal({backdrop: 'static', keyboard: false})

I noticed that every time he makes a confirmation executed

  modal.find('.commit').on('click', function () {
    if (options.onConfirm && options.onConfirm.call)
      options.onConfirm.call();

    modal.modal('hide');
  });