How to close Bootstrap modal only when user clicks on close image?

modal-dialog, twitter-bootstrap

Solution

When you launch your modal you can pass the options:

{
  keyboard: false,
  backdrop: 'static'
}

which will disable closing the modal by clicking the backdrop, and the escape-button. Or they can be set as `data-`attributes.

Problem

I want to close modal ONLY when user clicks on close btn. As I see I need to overwrite this part of code from modal.js: ``` hide: function (e) { e && e.preventDefault() var that = this e = $.Event('hide')//if I delete this line modal won't hide this.$element.trigger(e) if (!this.isShown || e.isDefaultPrevented()) return this.isShown = false $('body').removeClass('modal-open') escape.call(this) this.$element.removeClass('in') $.support.transition && this.$element.hasClass('fade') ? hideWithTransition.call(this) : hideModal.call(this) ``` Am I on the right path?

Original source