diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/bootstrap-modal.js | 2 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-modal.js | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 4530499eb..12abe06f1 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -148,7 +148,7 @@ } , removeBackdrop: function () { - this.$backdrop.remove() + this.$backdrop && this.$backdrop.remove() this.$backdrop = null } diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js index 98aa990a6..b0096f8ed 100644 --- a/js/tests/unit/bootstrap-modal.js +++ b/js/tests/unit/bootstrap-modal.js @@ -117,4 +117,21 @@ $(function () { }) .modal("toggle") }) + + test("should allow modal close with 'backdrop:false'", function () { + stop() + $.support.transition = false + var div = $("<div>", { id: 'modal-test', "data-backdrop": false }) + div + .bind("shown", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + div.modal("hide") + }) + .bind("hidden", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("show") + }) })
\ No newline at end of file |
