1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 12:59:05 +02:00

Adding flag to prevent backdrop click hiding modal

This commit is contained in:
Nick Veys
2011-09-17 14:47:38 -05:00
parent 732ff9ed1c
commit 2cb233319d
3 changed files with 74 additions and 3 deletions

View File

@@ -133,8 +133,10 @@
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if ( this.isShown && this.settings.backdrop ) {
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.click($.proxy(this.hide, this))
.appendTo(document.body)
if ( this.settings.backdropClickHides ) {
this.$backdrop.click($.proxy(this.hide, this))
}
this.$backdrop.appendTo(document.body)
setTimeout(function () {
that.$backdrop && that.$backdrop.addClass('in')
@@ -208,6 +210,7 @@
$.fn.modal.defaults = {
backdrop: false
, backdropClickHides: true
, keyboard: false
, show: true
}