aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorfat <[email protected]>2013-02-28 21:15:33 -0800
committerfat <[email protected]>2013-02-28 21:15:33 -0800
commit839b0c893fe2f2760682bee9dc49d5fa0b9c0412 (patch)
tree2764caf2be2fa945700a353de3576bcee71ea468 /js
parent0992a859329c80d15b9868fc426de8aefa1f8ea0 (diff)
downloadbootstrap-839b0c893fe2f2760682bee9dc49d5fa0b9c0412.tar.xz
bootstrap-839b0c893fe2f2760682bee9dc49d5fa0b9c0412.zip
shiiiit
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-modal.js2
-rw-r--r--js/tests/unit/bootstrap-modal.js17
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