Cancel button leaves extra elements in the DOM
Ajedi32 opened this issue · 4 comments
When you click a link or button that requires confirmation and then click cancel, twitter-bootstrap-rails-confirm leaves an extra hidden #confirmation_dialog
element in the DOM, even after the fade out animation completes.
That's actually by design. The second dialog won't create a new one (read: should not create a new one). Would you prefer that it removes and recreates it?
It doesn't reuse the old dialog though. After opening and closing the dialog a few times, I end up with multiple objects in the DOM with the id #confirmation_dialog
Ok, that's wrong. I'll dive in next week!
I think that the problem could be with: .on("hidden", -> $(this).remove())
In Bootstrap v3 the event is "hidden.bs.modal". It was "hidden" in v2.