diff options
| author | Nick Veys <[email protected]> | 2011-09-17 14:47:38 -0500 |
|---|---|---|
| committer | Nick Veys <[email protected]> | 2011-09-17 15:08:16 -0500 |
| commit | 2cb233319da422c9f003e8687d686e96a92be489 (patch) | |
| tree | 99622a861da1dc4bc0905f1fe6055fc10f630d45 /js/bootstrap-modal.js | |
| parent | 732ff9ed1c0b590c17951de412024cb7acd5763a (diff) | |
| download | bootstrap-2cb233319da422c9f003e8687d686e96a92be489.tar.xz bootstrap-2cb233319da422c9f003e8687d686e96a92be489.zip | |
Adding flag to prevent backdrop click hiding modal
Diffstat (limited to 'js/bootstrap-modal.js')
| -rw-r--r-- | js/bootstrap-modal.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index da6706073..98e5d4301 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -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 } |
