diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/bootstrap-modal.js | 13 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-modal.js | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 98e5d4301..d3e293ca8 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -89,7 +89,7 @@ that.$element .addClass('in') .trigger('shown') - }, 1) + }, 0) }) return this @@ -133,17 +133,19 @@ , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') - if ( this.settings.backdropClickHides ) { - this.$backdrop.click($.proxy(this.hide, this)) + .appendTo(document.body) + + if ( this.settings.backdrop != 'static' ) { + this.$backdrop.click($.proxy(this.hide, this)) } - this.$backdrop.appendTo(document.body) setTimeout(function () { that.$backdrop && that.$backdrop.addClass('in') $.support.transition && that.$backdrop.hasClass('fade') ? that.$backdrop.one(transitionEnd, callback) : callback() - }) + }, 0) + } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') @@ -210,7 +212,6 @@ $.fn.modal.defaults = { backdrop: false - , backdropClickHides: true , keyboard: false , show: true } diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js index 69e720f0f..be6babeef 100644 --- a/js/tests/unit/bootstrap-modal.js +++ b/js/tests/unit/bootstrap-modal.js @@ -137,7 +137,7 @@ $(function () { $.support.transition = false var div = $("<div id='modal-test'></div>") div - .modal({backdrop:true, backdropClickHides:false}) + .modal({backdrop: 'static'}) .modal("show") .bind("shown", function () { equal($('.modal-backdrop').length, 1, 'modal backdrop inserted into dom') |
