bluerail / twitter-bootstrap-rails-confirm

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

Cancel button leaves extra elements in the DOM #28

Closed Ajedi32 closed 8 years ago

Ajedi32 commented 9 years ago

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.

rvanlieshout commented 9 years ago

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?

Ajedi32 commented 9 years ago

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

rvanlieshout commented 9 years ago

Ok, that's wrong. I'll dive in next week!

lachdoug commented 8 years ago

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.