bluerail / twitter-bootstrap-rails-confirm

Confirm dialogs using Twitter Bootstrap
https://bluerail.nl
MIT License
85 stars 34 forks source link

Bootstrap 5.1 #39

Open estani opened 3 years ago

estani commented 3 years ago

In BS 5.1 there where a few changes. I fix this for my case, andd won't be using the gem anymore (thanks for sharing it though!)

I just wanted to share the problems, in case this want's to get fixed:

Some functions got removed from jquery so

typeof $().emulateTransitionEnd === 'function'
// does not exist anymore (the version is still properly saved in $.fn.tooltip.Constructor.VERSION[0])
typeof $().modal === 'function'
// won't work also, but this can be changed to:
typeof bootstrap.Modal === 'function'

And the modal itself changed too, so this is a html snippet for the modal that works as expected:

const MODAL=`
<div class="modal" id="confirmation_dialog" role="dialog">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header bg-light">
        <h4 class="modal-title">
          ...
        </h4>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body"></div>
      <div class="modal-footer"></div>
    </div>
  </div>
</div>
`