powmedia / backbone.bootstrap-modal

Bootstrap Modal wrapper for use with Backbone.
MIT License
183 stars 97 forks source link

Closing bootstrap alerts inside a modal closes the modal. #67

Open davidklebanoff opened 10 years ago

davidklebanoff commented 10 years ago

The close event on the modal listens for a click on the close class ('.close'). The problem is that Bootstrap uses this class for several elements in addition to the modal (e.g. dismissible alerts). Therefore if someone, for example, has an alert within a modal, two close classes will be present and the modal will be closed when the close button on the alert is clicked.

This can be easily fixed by eliminating the ambiguity of which close class belongs to the modal. One solution would be to add another class to the modal close button, such as 'modal-close'. We could then change the trigger event to be on '.modal-close' instead of just '.close'.